@@ -19,33 +19,30 @@ private predicate predictableInstruction(Instruction instr) {
1919 predictableInstruction ( instr .( UnaryInstruction ) .getUnary ( ) )
2020}
2121
22- private predicate userInputInstruction ( Instruction instr ) {
23- exists ( CallInstruction ci , WriteSideEffectInstruction wsei |
24- userInputArgument ( ci .getConvertedResultExpression ( ) , wsei .getIndex ( ) ) and
25- instr = wsei and
26- wsei .getPrimaryInstruction ( ) = ci
27- )
28- or
29- userInputReturned ( instr .getConvertedResultExpression ( ) )
30- or
31- isUserInput ( instr .getConvertedResultExpression ( ) , _)
32- or
33- instr .getConvertedResultExpression ( ) instanceof EnvironmentRead
34- or
35- instr
36- .( LoadInstruction )
37- .getSourceAddress ( )
38- .( VariableAddressInstruction )
39- .getASTVariable ( )
40- .hasName ( "argv" ) and
41- instr .getEnclosingFunction ( ) .hasGlobalName ( "main" )
42- }
43-
4422private class DefaultTaintTrackingCfg extends DataFlow:: Configuration {
4523 DefaultTaintTrackingCfg ( ) { this = "DefaultTaintTrackingCfg" }
4624
4725 override predicate isSource ( DataFlow:: Node source ) {
48- userInputInstruction ( source .asInstruction ( ) )
26+ exists ( CallInstruction ci , WriteSideEffectInstruction wsei |
27+ userInputArgument ( ci .getConvertedResultExpression ( ) , wsei .getIndex ( ) ) and
28+ source .asInstruction ( ) = wsei and
29+ wsei .getPrimaryInstruction ( ) = ci
30+ )
31+ or
32+ userInputReturned ( source .asExpr ( ) )
33+ or
34+ isUserInput ( source .asExpr ( ) , _)
35+ or
36+ source .asExpr ( ) instanceof EnvironmentRead
37+ or
38+ source
39+ .asInstruction ( )
40+ .( LoadInstruction )
41+ .getSourceAddress ( )
42+ .( VariableAddressInstruction )
43+ .getASTVariable ( )
44+ .hasName ( "argv" ) and
45+ source .asInstruction ( ) .getEnclosingFunction ( ) .hasGlobalName ( "main" )
4946 }
5047
5148 override predicate isSink ( DataFlow:: Node sink ) { any ( ) }
0 commit comments