Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#136 Archive/7z/7zIn.cpp:341: bad test ?

v1.0 (example)
open
nobody
None
5
2014-01-24
2014-01-24
dcb
No

I just ran the static analyser cppcheck over the source
code of version 9.20.1

It said many things, including

Archive/7z/7zIn.cpp:341]: (style) Array index 'pos' is used before limits check.

Source code is

  for (; buffer[pos] != '7' && pos < numTests; pos++);

Suggest code rework.

Discussion

  • Igor Pavlov
    Igor Pavlov
    2014-01-24

    It's not a bug.
    buffer is larger than "numTests".