Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/checknullpointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ namespace {
}

static const CWE CWE476(476U); // NULL Pointer Dereference
static const CWE CWE682(682U); // Incorrect Calculation

//---------------------------------------------------------------------------

Expand Down Expand Up @@ -538,7 +539,7 @@ void CheckNullPointer::arithmeticError(const Token *tok, const ValueFlow::Value
(value && value->condition) ? Severity::warning : Severity::error,
(value && value->condition) ? "nullPointerArithmeticRedundantCheck" : "nullPointerArithmetic",
errmsg,
CWE(0), // unknown - pointer overflow
CWE682, // unknown - pointer overflow
value && value->inconclusive);
}

3 changes: 2 additions & 1 deletion lib/checkother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ static const struct CWE CWE561(561U); // Dead Code
static const struct CWE CWE563(563U); // Assignment to Variable without Use ('Unused Variable')
static const struct CWE CWE570(570U); // Expression is Always False
static const struct CWE CWE571(571U); // Expression is Always True
static const struct CWE CWE672(672U); // Operation on a Resource after Expiration or Release
static const struct CWE CWE686(686U); // Function Call With Incorrect Argument Type
static const struct CWE CWE687(687U); // Function Call With Incorrectly Specified Argument Value
static const struct CWE CWE688(688U); // Function Call With Incorrect Variable or Reference as Argument
Expand Down Expand Up @@ -2768,6 +2769,6 @@ void CheckOther::accessMovedError(const Token *tok, const std::string &varname,
return;
}
const std::string errmsg(std::string("Access of ") + kindString + " variable " + varname + ".");
reportError(tok, Severity::warning, errorId, errmsg, CWE(0U), inconclusive);
reportError(tok, Severity::warning, errorId, errmsg, CWE672, inconclusive);
}