Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c53e39

Browse files
authored
Update CompilerRemovalOfCodeToClearBuffers.ql
1 parent 4c9de45 commit 9c53e39

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ class CompilerRemovaMemset extends FunctionCall {
2323
exists(DataFlow::Node source, DataFlow::Node sink, LocalVariable isv, Expr exp |
2424
DataFlow::localFlow(source, sink) and
2525
this.getArgument(0) = isv.getAnAccess() and
26-
source.asExpr() = exp and
26+
(
27+
source.asExpr() = exp
28+
or
29+
// handle the case where exp is defined by an address being passed into some function.
30+
source.asDefiningArgument() = exp
31+
) and
2732
exp.getLocation().getEndLine() < this.getArgument(0).getLocation().getStartLine() and
2833
sink.asExpr() = this.getArgument(0)
2934
)

0 commit comments

Comments
 (0)