From 5b6ec49a6fe15d893c6fb42977e74a110bd02c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 27 Jan 2018 22:09:43 +0100 Subject: [PATCH] Pointer overflow: Fixed false positive --- lib/checkbufferoverrun.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index f23b36b33..adcd48696 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -1507,7 +1507,7 @@ void CheckBufferOverrun::bufferOverrun() continue; const Variable *var = pointerToken->variable(); - if (!var || !var->isArray()) + if (!var || !var->isArray() || var->dimension(0) <= 0) continue; const ValueFlow::Value *value = indexToken->getValueGE(var->dimension(0)+1, _settings);