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 11
11
* external/cwe/cwe-664
12
12
*/
13
13
14
- // IMPORTANT: This query does not currently find anything since it relies on extractor and analysis improvements that hasn't yet been released
15
14
import cpp
16
15
import semmle.code.cpp.ir.IR
17
16
import semmle.code.cpp.dataflow.new.DataFlow
18
17
import semmle.code.cpp.models.implementations.StdContainer
19
18
import semmle.code.cpp.models.implementations.StdMap
20
19
import semmle.code.cpp.models.implementations.Iterator
21
20
21
+ private predicate tempToDestructorSink ( DataFlow:: Node sink , CallInstruction call ) {
22
+ call = sink .asOperand ( ) .( ThisArgumentOperand ) .getCall ( ) and
23
+ call .getStaticCallTarget ( ) instanceof Destructor
24
+ }
25
+
22
26
/**
23
27
* A configuration to track flow from a temporary variable to the qualifier of
24
28
* a destructor call
@@ -28,9 +32,7 @@ module TempToDestructorConfig implements DataFlow::ConfigSig {
28
32
source .asInstruction ( ) .( VariableAddressInstruction ) .getIRVariable ( ) instanceof IRTempVariable
29
33
}
30
34
31
- predicate isSink ( DataFlow:: Node sink ) {
32
- sink .asOperand ( ) .( ThisArgumentOperand ) .getCall ( ) .getStaticCallTarget ( ) instanceof Destructor
33
- }
35
+ predicate isSink ( DataFlow:: Node sink ) { tempToDestructorSink ( sink , _) }
34
36
}
35
37
36
38
module TempToDestructorFlow = DataFlow:: Global< TempToDestructorConfig > ;
You can’t perform that action at this time.
0 commit comments