cppcheck reports OOB access on the attached file:
$ cppcheck falsepositive.c Checking falsepositive.c ... [falsepositive.c:17]: (error) Array 'words[100]' accessed at index 9998, which is out of bounds.
Cppcheck 1.88 dev (at eade2bb2c).
I created this ticket: https://trac.cppcheck.net/ticket/9126
I believe this is due to aa05bf0f1659bffc23a458d461b0afc1e181e59e. When execute-ing the && of
(i < num_words) && (f < MAX_LINE_WORDS - 1)
the lhs returns an error (because we don't have the value for num_words), and then the error is swallowed as the rhs is processed without error.
Log in to post a comment.
cppcheck reports OOB access on the attached file:
$ cppcheck falsepositive.c
Checking falsepositive.c ...
[falsepositive.c:17]: (error) Array 'words[100]' accessed at index 9998, which is out of bounds.
Cppcheck 1.88 dev (at eade2bb2c).
I created this ticket: https://trac.cppcheck.net/ticket/9126
I believe this is due to aa05bf0f1659bffc23a458d461b0afc1e181e59e.
When execute-ing the && of
the lhs returns an error (because we don't have the value for num_words), and then the error is swallowed as the rhs is processed without error.