@@ -2,14 +2,15 @@ import cpp
2
2
import semmle.code.cpp.security.Security
3
3
private import semmle.code.cpp.ir.dataflow.DataFlow
4
4
private import semmle.code.cpp.ir.dataflow.internal.DataFlowUtil
5
- private import semmle.code.cpp.ir.dataflow.DataFlow2
5
+ private import semmle.code.cpp.ir.dataflow.DataFlow3
6
6
private import semmle.code.cpp.ir.IR
7
7
private import semmle.code.cpp.ir.dataflow.internal.DataFlowDispatch as Dispatch
8
8
private import semmle.code.cpp.controlflow.IRGuards
9
9
private import semmle.code.cpp.models.interfaces.Taint
10
10
private import semmle.code.cpp.models.interfaces.DataFlow
11
11
private import semmle.code.cpp.ir.dataflow.TaintTracking
12
12
private import semmle.code.cpp.ir.dataflow.TaintTracking2
13
+ private import semmle.code.cpp.ir.dataflow.TaintTracking3
13
14
private import semmle.code.cpp.ir.dataflow.internal.ModelUtil
14
15
15
16
/**
@@ -380,7 +381,7 @@ module TaintedWithPath {
380
381
string toString ( ) { result = "TaintTrackingConfiguration" }
381
382
}
382
383
383
- private class AdjustedConfiguration extends TaintTracking2 :: Configuration {
384
+ private class AdjustedConfiguration extends TaintTracking3 :: Configuration {
384
385
AdjustedConfiguration ( ) { this = "AdjustedConfiguration" }
385
386
386
387
override predicate isSource ( DataFlow:: Node source ) {
@@ -438,11 +439,11 @@ module TaintedWithPath {
438
439
*/
439
440
440
441
private newtype TPathNode =
441
- TWrapPathNode ( DataFlow2 :: PathNode n ) or
442
+ TWrapPathNode ( DataFlow3 :: PathNode n ) or
442
443
// There's a single newtype constructor for both sources and sinks since
443
444
// that makes it easiest to deal with the case where source = sink.
444
445
TEndpointPathNode ( Element e ) {
445
- exists ( AdjustedConfiguration cfg , DataFlow2 :: Node sourceNode , DataFlow2 :: Node sinkNode |
446
+ exists ( AdjustedConfiguration cfg , DataFlow3 :: Node sourceNode , DataFlow3 :: Node sinkNode |
446
447
cfg .hasFlow ( sourceNode , sinkNode )
447
448
|
448
449
sourceNode = getNodeForExpr ( e ) and
@@ -473,7 +474,7 @@ module TaintedWithPath {
473
474
}
474
475
475
476
private class WrapPathNode extends PathNode , TWrapPathNode {
476
- DataFlow2 :: PathNode inner ( ) { this = TWrapPathNode ( result ) }
477
+ DataFlow3 :: PathNode inner ( ) { this = TWrapPathNode ( result ) }
477
478
478
479
override string toString ( ) { result = this .inner ( ) .toString ( ) }
479
480
@@ -510,25 +511,25 @@ module TaintedWithPath {
510
511
511
512
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
512
513
query predicate edges ( PathNode a , PathNode b ) {
513
- DataFlow2 :: PathGraph:: edges ( a .( WrapPathNode ) .inner ( ) , b .( WrapPathNode ) .inner ( ) )
514
+ DataFlow3 :: PathGraph:: edges ( a .( WrapPathNode ) .inner ( ) , b .( WrapPathNode ) .inner ( ) )
514
515
or
515
516
// To avoid showing trivial-looking steps, we _replace_ the last node instead
516
517
// of adding an edge out of it.
517
518
exists ( WrapPathNode sinkNode |
518
- DataFlow2 :: PathGraph:: edges ( a .( WrapPathNode ) .inner ( ) , sinkNode .inner ( ) ) and
519
+ DataFlow3 :: PathGraph:: edges ( a .( WrapPathNode ) .inner ( ) , sinkNode .inner ( ) ) and
519
520
b .( FinalPathNode ) .inner ( ) = adjustedSink ( sinkNode .inner ( ) .getNode ( ) )
520
521
)
521
522
or
522
523
// Same for the first node
523
524
exists ( WrapPathNode sourceNode |
524
- DataFlow2 :: PathGraph:: edges ( sourceNode .inner ( ) , b .( WrapPathNode ) .inner ( ) ) and
525
+ DataFlow3 :: PathGraph:: edges ( sourceNode .inner ( ) , b .( WrapPathNode ) .inner ( ) ) and
525
526
sourceNode .inner ( ) .getNode ( ) = getNodeForExpr ( a .( InitialPathNode ) .inner ( ) )
526
527
)
527
528
or
528
529
// Finally, handle the case where the path goes directly from a source to a
529
530
// sink, meaning that they both need to be translated.
530
531
exists ( WrapPathNode sinkNode , WrapPathNode sourceNode |
531
- DataFlow2 :: PathGraph:: edges ( sourceNode .inner ( ) , sinkNode .inner ( ) ) and
532
+ DataFlow3 :: PathGraph:: edges ( sourceNode .inner ( ) , sinkNode .inner ( ) ) and
532
533
sourceNode .inner ( ) .getNode ( ) = getNodeForExpr ( a .( InitialPathNode ) .inner ( ) ) and
533
534
b .( FinalPathNode ) .inner ( ) = adjustedSink ( sinkNode .inner ( ) .getNode ( ) )
534
535
)
@@ -550,7 +551,7 @@ module TaintedWithPath {
550
551
* the computation.
551
552
*/
552
553
predicate taintedWithPath ( Expr source , Element tainted , PathNode sourceNode , PathNode sinkNode ) {
553
- exists ( AdjustedConfiguration cfg , DataFlow2 :: Node flowSource , DataFlow2 :: Node flowSink |
554
+ exists ( AdjustedConfiguration cfg , DataFlow3 :: Node flowSource , DataFlow3 :: Node flowSink |
554
555
source = sourceNode .( InitialPathNode ) .inner ( ) and
555
556
flowSource = getNodeForExpr ( source ) and
556
557
cfg .hasFlow ( flowSource , flowSink ) and
0 commit comments