From 58e26ab1fc4a2acacbc377ff3dd00364a863e313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 1 May 2010 11:55:26 +0200 Subject: [PATCH] Fixed Cppcheck warning about possible null pointer dereference --- lib/checkbufferoverrun.cpp | 2 ++ 1 file changed, 2 insertions(+) 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; }