@@ -109,9 +109,7 @@ module StringBreak {
109
109
class StringsNewReplacerCall extends DataFlow:: CallNode {
110
110
StringsNewReplacerCall ( ) { this .getTarget ( ) .hasQualifiedName ( "strings" , "NewReplacer" ) }
111
111
112
- DataFlow:: Node getAReplacedArgument ( ) {
113
- exists ( int m , int n | m = 2 * n and n = m / 2 and result = getArgument ( m ) )
114
- }
112
+ DataFlow:: Node getAReplacedArgument ( ) { exists ( int n | n % 2 = 0 and result = getArgument ( n ) ) }
115
113
}
116
114
117
115
class StringsNewReplacerConfiguration extends DataFlow2:: Configuration {
@@ -135,10 +133,14 @@ module StringBreak {
135
133
Quote quote ;
136
134
137
135
ReplacerReplaceSanitizer ( ) {
138
- exists ( StringsNewReplacerConfiguration config , DataFlow:: Node source , DataFlow:: Node sink |
136
+ exists (
137
+ StringsNewReplacerConfiguration config , DataFlow:: Node source , DataFlow:: Node sink ,
138
+ DataFlow:: MethodCallNode call
139
+ |
139
140
config .hasFlow ( source , sink ) and
140
- this .getTarget ( ) .hasQualifiedName ( "strings" , "Replacer" , "Replace" ) and
141
- sink = this .getReceiver ( ) and
141
+ call .getTarget ( ) .hasQualifiedName ( "strings" , "Replacer" , "Replace" ) and
142
+ sink = call .getReceiver ( ) and
143
+ this = call .getResult ( ) and
142
144
quote = source .( StringsNewReplacerCall ) .getAReplacedArgument ( ) .getStringValue ( )
143
145
)
144
146
}
0 commit comments