Add message id arrayIndexOutOfBoundsCond

This commit is contained in:
Daniel Marjamäki 2019-03-11 19:12:03 +01:00
parent 5461fb64e3
commit a933261e14
1 changed files with 2 additions and 1 deletions

View File

@ -248,12 +248,13 @@ void CheckBufferOverrun::arrayIndexError(const Token *tok, const Variable *var,
{ {
if (!tok) { if (!tok) {
reportError(tok, Severity::error, "arrayIndexOutOfBounds", "Array 'arr[16]' accessed at index 16, which is out of bounds.", CWE788, false); 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; return;
} }
reportError(getErrorPath(tok, index, "Array index out of bounds"), reportError(getErrorPath(tok, index, "Array index out of bounds"),
index->errorSeverity() ? Severity::error : Severity::warning, index->errorSeverity() ? Severity::error : Severity::warning,
"arrayIndexOutOfBounds", index->condition ? "arrayIndexOutOfBounds" : "arrayIndexOutOfBoundsCond",
arrayIndexMessage(tok, var, index), arrayIndexMessage(tok, var, index),
CWE788, CWE788,
index->isInconclusive()); index->isInconclusive());