Fixed Cppcheck warning about possible null pointer dereference

This commit is contained in:
Daniel Marjamäki 2010-05-01 11:55:26 +02:00
parent dfde9772e2
commit 58e26ab1fc
1 changed files with 2 additions and 0 deletions

View File

@ -1125,6 +1125,8 @@ void CheckBufferOverrun::checkGlobalAndLocalVariable()
{ {
while (tok && tok->str() != ";") while (tok && tok->str() != ";")
tok = tok->next(); tok = tok->next();
if (!tok)
break;
checkScope(tok, arrayInfo); checkScope(tok, arrayInfo);
continue; continue;
} }