From 5ae6234729dd15378f85766a890697069569e155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 20 Jul 2014 11:44:25 +0200 Subject: [PATCH] Fixed #5978 (false positive: Array 'm_pool_vector[-1]' accessed at index 0, which is out of bounds.) --- lib/checkbufferoverrun.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index 1084d83c1..6b1e82f41 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -758,8 +758,8 @@ void CheckBufferOverrun::valueFlowCheckArrayIndex(const Token * const tok, const totalElements *= arrayInfo.num(ri); } - // totalElements == 0 => Unknown size - if (totalElements == 0) + // totalElements <= 0 => Unknown size + if (totalElements <= 0) continue; // taking address of 1 past end?