Skip to content

Commit

Permalink
Fix nasa#54, pass actual size of buffer
Browse files Browse the repository at this point in the history
The test must not pass a buffer size larger than the actual
buffer, or else it will read beyond the end.
  • Loading branch information
jphickey committed Dec 1, 2021
1 parent 7b99b91 commit 95fac79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unit-test/cf_cfdp_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -1876,7 +1876,7 @@ void Test_CF_strnlen_When_end_IsNot_NULL_ReturnLengthOfGiven_s(void)
{
/* Arrange */
const char arg_s[7] = "NO NULL";
size_t arg_maxlen = 8; /* 256 is arbitrary and used for small size */
size_t arg_maxlen = 7; /* 256 is arbitrary and used for small size */
size_t expected_length = 7;
size_t local_result;

Expand Down

0 comments on commit 95fac79

Please sign in to comment.