Skip to content

Commit 1c4610c

Browse files
ihsinmeMathiasVP
andauthored
Update cpp/ql/src/experimental/Security/CWE/CWE-14/CompilerRemovalOfCodeToClearBuffers.ql
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
1 parent 3ad45f2 commit 1c4610c

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

cpp/ql/src/experimental/Security/CWE/CWE-14/CompilerRemovalOfCodeToClearBuffers.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ class CompilerRemovaMemset extends FunctionCall {
3838
}
3939

4040
predicate isExistsFreeForThisVariable() {
41-
exists(FunctionCall free, Variable v |
42-
free instanceof DeallocationExpr and
41+
exists(DeallocationExpr free, Variable v |
4342
this.getArgument(0) = v.getAnAccess() and
44-
free.getArgument(0) = v.getAnAccess() and
43+
free.getFreedExpr() = v.getAnAccess() and
4544
this.getASuccessor+() = free
4645
)
4746
}

0 commit comments

Comments
 (0)