Hi, I found a false negative regarding the rule arrayIndexOutOfBounds.
In the following C++ program, cppcheck should report an arrayIndexOutOfBounds warning because a dynamic array of size 2 is accessed at index 2. However, cppcheck reports no such warning.
Hi, I found a false negative regarding the rule
arrayIndexOutOfBounds.In the following C++ program, cppcheck should report an
arrayIndexOutOfBoundswarning because a dynamic array of size 2 is accessed at index 2. However, cppcheck reports no such warning.Actual result
Cppcheck reports no
arrayIndexOutOfBoundswarning.Expected result
Cppcheck should report
arrayIndexOutOfBoundsfor the write toa[2].Verification
The issue was reproduced with:
Version: 2.21.0
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/14934