From a933261e14c99109de6689f13f5df26549457b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 11 Mar 2019 19:12:03 +0100 Subject: [PATCH] Add message id arrayIndexOutOfBoundsCond --- lib/checkbufferoverrun.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index eaa541d0c..5f496b3c6 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -248,12 +248,13 @@ void CheckBufferOverrun::arrayIndexError(const Token *tok, const Variable *var, { if (!tok) { reportError(tok, Severity::error, "arrayIndexOutOfBounds", "Array 'arr[16]' accessed at index 16, which is out of bounds.", CWE788, false); + reportError(tok, Severity::warning, "arrayIndexOutOfBoundsCond", "Array 'arr[16]' accessed at index 16, which is out of bounds.", CWE788, false); return; } reportError(getErrorPath(tok, index, "Array index out of bounds"), index->errorSeverity() ? Severity::error : Severity::warning, - "arrayIndexOutOfBounds", + index->condition ? "arrayIndexOutOfBounds" : "arrayIndexOutOfBoundsCond", arrayIndexMessage(tok, var, index), CWE788, index->isInconclusive());