@@ -2,14 +2,15 @@ import cpp
22import semmle.code.cpp.security.Security
33private import semmle.code.cpp.ir.dataflow.DataFlow
44private 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
66private import semmle.code.cpp.ir.IR
77private import semmle.code.cpp.ir.dataflow.internal.DataFlowDispatch as Dispatch
88private import semmle.code.cpp.controlflow.IRGuards
99private import semmle.code.cpp.models.interfaces.Taint
1010private import semmle.code.cpp.models.interfaces.DataFlow
1111private import semmle.code.cpp.ir.dataflow.TaintTracking
1212private import semmle.code.cpp.ir.dataflow.TaintTracking2
13+ private import semmle.code.cpp.ir.dataflow.TaintTracking3
1314private import semmle.code.cpp.ir.dataflow.internal.ModelUtil
1415
1516/**
@@ -380,7 +381,7 @@ module TaintedWithPath {
380381 string toString ( ) { result = "TaintTrackingConfiguration" }
381382 }
382383
383- private class AdjustedConfiguration extends TaintTracking2 :: Configuration {
384+ private class AdjustedConfiguration extends TaintTracking3 :: Configuration {
384385 AdjustedConfiguration ( ) { this = "AdjustedConfiguration" }
385386
386387 override predicate isSource ( DataFlow:: Node source ) {
@@ -438,11 +439,11 @@ module TaintedWithPath {
438439 */
439440
440441 private newtype TPathNode =
441- TWrapPathNode ( DataFlow2 :: PathNode n ) or
442+ TWrapPathNode ( DataFlow3 :: PathNode n ) or
442443 // There's a single newtype constructor for both sources and sinks since
443444 // that makes it easiest to deal with the case where source = sink.
444445 TEndpointPathNode ( Element e ) {
445- exists ( AdjustedConfiguration cfg , DataFlow2 :: Node sourceNode , DataFlow2 :: Node sinkNode |
446+ exists ( AdjustedConfiguration cfg , DataFlow3 :: Node sourceNode , DataFlow3 :: Node sinkNode |
446447 cfg .hasFlow ( sourceNode , sinkNode )
447448 |
448449 sourceNode = getNodeForExpr ( e ) and
@@ -473,7 +474,7 @@ module TaintedWithPath {
473474 }
474475
475476 private class WrapPathNode extends PathNode , TWrapPathNode {
476- DataFlow2 :: PathNode inner ( ) { this = TWrapPathNode ( result ) }
477+ DataFlow3 :: PathNode inner ( ) { this = TWrapPathNode ( result ) }
477478
478479 override string toString ( ) { result = this .inner ( ) .toString ( ) }
479480
@@ -510,25 +511,25 @@ module TaintedWithPath {
510511
511512 /** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
512513 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 ( ) )
514515 or
515516 // To avoid showing trivial-looking steps, we _replace_ the last node instead
516517 // of adding an edge out of it.
517518 exists ( WrapPathNode sinkNode |
518- DataFlow2 :: PathGraph:: edges ( a .( WrapPathNode ) .inner ( ) , sinkNode .inner ( ) ) and
519+ DataFlow3 :: PathGraph:: edges ( a .( WrapPathNode ) .inner ( ) , sinkNode .inner ( ) ) and
519520 b .( FinalPathNode ) .inner ( ) = adjustedSink ( sinkNode .inner ( ) .getNode ( ) )
520521 )
521522 or
522523 // Same for the first node
523524 exists ( WrapPathNode sourceNode |
524- DataFlow2 :: PathGraph:: edges ( sourceNode .inner ( ) , b .( WrapPathNode ) .inner ( ) ) and
525+ DataFlow3 :: PathGraph:: edges ( sourceNode .inner ( ) , b .( WrapPathNode ) .inner ( ) ) and
525526 sourceNode .inner ( ) .getNode ( ) = getNodeForExpr ( a .( InitialPathNode ) .inner ( ) )
526527 )
527528 or
528529 // Finally, handle the case where the path goes directly from a source to a
529530 // sink, meaning that they both need to be translated.
530531 exists ( WrapPathNode sinkNode , WrapPathNode sourceNode |
531- DataFlow2 :: PathGraph:: edges ( sourceNode .inner ( ) , sinkNode .inner ( ) ) and
532+ DataFlow3 :: PathGraph:: edges ( sourceNode .inner ( ) , sinkNode .inner ( ) ) and
532533 sourceNode .inner ( ) .getNode ( ) = getNodeForExpr ( a .( InitialPathNode ) .inner ( ) ) and
533534 b .( FinalPathNode ) .inner ( ) = adjustedSink ( sinkNode .inner ( ) .getNode ( ) )
534535 )
@@ -550,7 +551,7 @@ module TaintedWithPath {
550551 * the computation.
551552 */
552553 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 |
554555 source = sourceNode .( InitialPathNode ) .inner ( ) and
555556 flowSource = getNodeForExpr ( source ) and
556557 cfg .hasFlow ( flowSource , flowSink ) and
0 commit comments