You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After discussion with Joe and Jose about similar instances where CodeSonar flagged certain functions (like strcpy) for not having bounds checking (though bounds checking was done right before the function) I'm marking on our CodeSonar website to ignore these lines.
Background Info Into Why This Became An Issue
CodeSonar flagged the following error: BADFUNC.BO.STRCPY : Use of strcpy
CodeSonar Summary: A use of strcpy() or a similar function (see full list below), which are vulnerable to buffer overflows.
CodeSonar Resolution Suggestion: Use a function that does bounds checking, such as strncpy(), StrCbCopy(), or StrCchCopy().
The issue seems to be a concern over buffer overflow. However, in this case, though strcpy itself isn't bounds checking, there is bounds checking being done immediately beforehand.
Discussion about CodeSonar and this issue
Today (6/23/26) during our cFS + DARPA meeting, we discussed this issue and pull request. The PR #2768 included two comments to tell CodeSonar to ignore the line. This comment needs to be on every individual line that needs to be ignored.
We decided during the meeting that instead of having a million comments everywhere telling CodeSonar to ignore certain lines, we'll instead log into CodeSonar and tell it to ignore false positives from there. That way, if the project decides to stop using CodeSonar in favor of using a different static analyzer, we won't have a bunch of useless comments everywhere in the code.
Activity
Fix #2737, fix-2737 branch needed to be updated.
Fix #2737, CodeSonar SAD comments need to be on the line that needs t…
Fix #2737, Merge branch 'fix-2737-cfe-use-of-strcpy' of github.com:na…
elizabash commentedon Jun 23, 2026
After discussion with Joe and Jose about similar instances where CodeSonar flagged certain functions (like strcpy) for not having bounds checking (though bounds checking was done right before the function) I'm marking on our CodeSonar website to ignore these lines.
Background Info Into Why This Became An Issue
CodeSonar flagged the following error: BADFUNC.BO.STRCPY : Use of strcpy
CodeSonar Summary: A use of strcpy() or a similar function (see full list below), which are vulnerable to buffer overflows.
CodeSonar Resolution Suggestion: Use a function that does bounds checking, such as strncpy(), StrCbCopy(), or StrCchCopy().
The issue seems to be a concern over buffer overflow. However, in this case, though strcpy itself isn't bounds checking, there is bounds checking being done immediately beforehand.
Discussion about CodeSonar and this issue
Today (6/23/26) during our cFS + DARPA meeting, we discussed this issue and pull request. The PR #2768 included two comments to tell CodeSonar to ignore the line. This comment needs to be on every individual line that needs to be ignored.
We decided during the meeting that instead of having a million comments everywhere telling CodeSonar to ignore certain lines, we'll instead log into CodeSonar and tell it to ignore false positives from there. That way, if the project decides to stop using CodeSonar in favor of using a different static analyzer, we won't have a bunch of useless comments everywhere in the code.