Skip to content

Commit c8eeb5f

Browse files
authored
Update WrongInDetectingAndHandlingMemoryAllocationErrors.ql
1 parent bdfdcbd commit c8eeb5f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cpp/ql/src/experimental/Security/CWE/CWE-570/WrongInDetectingAndHandlingMemoryAllocationErrors.ql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class IfCompareWithZero extends IfStmt {
2222
or
2323
this.getCondition().(NEExpr).getAChild().getValue() = "0" and
2424
this.hasElse()
25+
or
26+
this.getCondition().(NEExpr).getAChild().getValue() = "0" and
27+
this.getThen().getAChild*() instanceof ReturnStmt
2528
}
2629
}
2730

0 commit comments

Comments
 (0)