From 5087dc6b469312e6548496c40000c871e29ae23f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 6 Aug 2009 21:48:22 +0200 Subject: [PATCH] Bail out if variable id is 0. This should be reverted when #563 has been fixed --- src/checkbufferoverrun.cpp | 3 +++ 1 file changed, 3 insertions(+) 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)) {