@@ -109,9 +109,7 @@ module StringBreak {
109109 class StringsNewReplacerCall extends DataFlow:: CallNode {
110110 StringsNewReplacerCall ( ) { this .getTarget ( ) .hasQualifiedName ( "strings" , "NewReplacer" ) }
111111
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 ) ) }
115113 }
116114
117115 class StringsNewReplacerConfiguration extends DataFlow2:: Configuration {
@@ -135,10 +133,14 @@ module StringBreak {
135133 Quote quote ;
136134
137135 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+ |
139140 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
142144 quote = source .( StringsNewReplacerCall ) .getAReplacedArgument ( ) .getStringValue ( )
143145 )
144146 }
0 commit comments