diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index 8faa7f707..422e3bb6d 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -1125,6 +1125,8 @@ void CheckBufferOverrun::checkGlobalAndLocalVariable() { while (tok && tok->str() != ";") tok = tok->next(); + if (!tok) + break; checkScope(tok, arrayInfo); continue; }