cppcheck
cppcheck copied to clipboard
Fix strcpy memory overlap false negative
Cppcheck does not report undefined behavior of strcpy memory overlap, however it reports the problem for strncpy.
I have found the commit where the new feature for strncpy is added, with a possibly relevant comment:
https://github.com/danmar/cppcheck/commit/6234b5438ee1be035e9581c3367f037bf66bac42#commitcomment-53225278
So far I have added tests with expected behavior, which should clarify the problem.
The next step will be trying to remove the false negative.