File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
cpp/ql/src/experimental/Security/CWE/CWE-416 Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1111 * external/cwe/cwe-664
1212 */
1313
14- // IMPORTANT: This query does not currently find anything since it relies on extractor and analysis improvements that hasn't yet been released
1514import cpp
1615import semmle.code.cpp.ir.IR
1716import semmle.code.cpp.dataflow.new.DataFlow
1817import semmle.code.cpp.models.implementations.StdContainer
1918import semmle.code.cpp.models.implementations.StdMap
2019import semmle.code.cpp.models.implementations.Iterator
2120
21+ private predicate tempToDestructorSink ( DataFlow:: Node sink , CallInstruction call ) {
22+ call = sink .asOperand ( ) .( ThisArgumentOperand ) .getCall ( ) and
23+ call .getStaticCallTarget ( ) instanceof Destructor
24+ }
25+
2226/**
2327 * A configuration to track flow from a temporary variable to the qualifier of
2428 * a destructor call
@@ -28,9 +32,7 @@ module TempToDestructorConfig implements DataFlow::ConfigSig {
2832 source .asInstruction ( ) .( VariableAddressInstruction ) .getIRVariable ( ) instanceof IRTempVariable
2933 }
3034
31- predicate isSink ( DataFlow:: Node sink ) {
32- sink .asOperand ( ) .( ThisArgumentOperand ) .getCall ( ) .getStaticCallTarget ( ) instanceof Destructor
33- }
35+ predicate isSink ( DataFlow:: Node sink ) { tempToDestructorSink ( sink , _) }
3436}
3537
3638module TempToDestructorFlow = DataFlow:: Global< TempToDestructorConfig > ;
You can’t perform that action at this time.
0 commit comments