Fixed #2393 (Token::Match called with varid 0)

This commit is contained in:
Daniel Marjamäki 2011-01-04 18:34:51 +01:00
parent 2c6421d162
commit c2a194ead0
1 changed files with 1 additions and 1 deletions

View File

@ -925,7 +925,7 @@ void CheckBufferOverrun::checkScope(const Token *tok, const std::vector<std::str
}
// undefined behaviour: result of pointer arithmetic is out of bounds
if (Token::Match(tok, "= %varid% + %num% ;", varid))
if (varid && Token::Match(tok, "= %varid% + %num% ;", varid))
{
const MathLib::bigint index = MathLib::toLongNumber(tok->strAt(3));
if (index > size && _settings->_checkCodingStyle)