diff --git a/src/checkbufferoverrun.cpp b/src/checkbufferoverrun.cpp index 34d718529..3dc2ead30 100644 --- a/src/checkbufferoverrun.cpp +++ b/src/checkbufferoverrun.cpp @@ -248,6 +248,9 @@ void CheckBufferOverrun::checkScope(const Token *tok, const char *varname[], con else continue; + /** @todo this condition should be redundant, the variable id should never be 0 for variables */ + if (counter_varid == 0) + continue; if (Token::Match(tok2, "%varid% < %num% ;", counter_varid)) {