From ac8d283afbf4191643cd9e34cf3b295d87b5787a Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Mon, 12 May 2014 17:18:51 +0200 Subject: [PATCH] Fixed CID 1214638: Dereference before null check (REVERSE_INULL). --- lib/checknullpointer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checknullpointer.cpp b/lib/checknullpointer.cpp index efa7f2217..542520eeb 100644 --- a/lib/checknullpointer.cpp +++ b/lib/checknullpointer.cpp @@ -886,7 +886,7 @@ void CheckNullPointer::nullConstantDereference() if (Token::Match(tok2->previous(), ";|{|}|:|(")) break; } - if (tok2->previous()->str()=="(") + if (tok2 && tok2->previous() && tok2->previous()->str()=="(") continue; if (Token::simpleMatch(tok2, "std :: cin")) nullPointerError(tok);