From 7321f92effc5291da03846d3a30506973e31a487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 12 Dec 2013 12:36:49 +0100 Subject: [PATCH] CheckUninitVar: Fix Coverity warning about possible null pointer. --- lib/checkuninitvar.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/checkuninitvar.cpp b/lib/checkuninitvar.cpp index eced88f57..666ca00c2 100644 --- a/lib/checkuninitvar.cpp +++ b/lib/checkuninitvar.cpp @@ -1086,6 +1086,8 @@ void CheckUninitVar::checkScope(const Scope* scope) } while (tok && tok->str() != ";") tok = tok->next(); + if (!tok) + continue; if (Token::findsimplematch(i->typeStartToken(), "=", tok)) continue; if (stdtype || i->isPointer()) {