We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6163fd commit ade82efCopy full SHA for ade82ef
1 file changed
ut_assert/src/utassert.c
@@ -180,7 +180,12 @@ void UtAssert_EndTest(void)
180
}
181
memcpy(&Local_SegmentCounters, &UT_SegmentCounters, sizeof(Local_SegmentCounters));
182
183
- strncpy(Local_SegmentName, CurrentSegment, sizeof(Local_SegmentName) - 1);
+ /*
184
+ * note, strcpy is OK because both are fixed size buffers of the same size,
185
+ * and the null termination on CurrentSegment was locally enforced already
186
+ * SAD: This should be ignored by CodeSonar.
187
+ */
188
+ strcpy(Local_SegmentName, CurrentSegment);
189
190
191
memset(&UT_SegmentCounters, 0, sizeof(UT_SegmentCounters));
0 commit comments