From 503662f625fbe2cd7bc48722c492b457a3748373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 15 Jan 2021 08:27:58 +0100 Subject: [PATCH] Try to fix null pointer dereference --- lib/checkstl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index 41be4ed9b..ac51a00cd 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -1559,7 +1559,7 @@ void CheckStl::checkFindInsert() if (!containerTok) continue; // In < C++17 we only warn for small simple types - if (!(keyTok->valueType()->isIntegral() || keyTok->valueType()->pointer > 0) && mSettings->standards.cpp < Standards::CPP17) + if (mSettings->standards.cpp < Standards::CPP17 && !(keyTok && keyTok->valueType() && (keyTok->valueType()->isIntegral() || keyTok->valueType()->pointer > 0))) continue; const Token *thenTok = tok->next()->link()->next();