Update cpp/ql/src/Security/CWE/CWE-570/IncorrectAllocationErrorHandling.ql

Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
This commit is contained in:
Mathias Vorreiter Pedersen
2024-06-25 10:03:53 +01:00
committed by GitHub
parent 982f845be7
commit 921afb71e2

View File

@@ -216,7 +216,7 @@ predicate noThrowInTryBlock(NewOrNewArrayExpr newExpr, BadAllocCatchBlock catchB
predicate nullCheckInThrowingNew(NewOrNewArrayExpr newExpr, GuardCondition guard) {
newExpr.getAllocator() instanceof ThrowingAllocator and
// There can be many guard conditions that compares `newExpr` againgst 0.
// For example, for `if(!p)` both `p` and `!p` is a guard condition. To not
// For example, for `if(!p)` both `p` and `!p` are guard conditions. To not
// produce duplicates results we pick the "first" guard condition according
// to some arbitrary ordering (i.e., location information). This means `!p` is the
// element that we use to construct the alert.