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

Skip to content

Commit 4c9de45

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

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import cpp
1414
import semmle.code.cpp.dataflow.DataFlow
15+
import semmle.code.cpp.dataflow.StackAddress
1516

1617
/**
1718
* A call to `memset` of the form `memset(ptr, value, num)`, for some local variable `ptr`.
@@ -34,6 +35,8 @@ class CompilerRemovaMemset extends FunctionCall {
3435
this.getArgument(0) = v.getAnAccess() and
3536
alloc.getASuccessor+() = this
3637
)
38+
or
39+
not stackPointerFlowsToUse(this.getArgument(0), _, _, _)
3740
}
3841

3942
predicate isExistsFreeForThisVariable() {

0 commit comments

Comments
 (0)