File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
go/ql/lib/semmle/go/security Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -106,12 +106,24 @@ module StringBreak {
106
106
override Quote getQuote ( ) { result = quote }
107
107
}
108
108
109
+ /**
110
+ * A call to `strings.NewReplacer`.
111
+ */
109
112
class StringsNewReplacerCall extends DataFlow:: CallNode {
110
113
StringsNewReplacerCall ( ) { this .getTarget ( ) .hasQualifiedName ( "strings" , "NewReplacer" ) }
111
114
115
+ /**
116
+ * Gets an argument to this call corresponding to a string that will be
117
+ * replaced.
118
+ */
112
119
DataFlow:: Node getAReplacedArgument ( ) { exists ( int n | n % 2 = 0 and result = getArgument ( n ) ) }
113
120
}
114
121
122
+ /**
123
+ * A configuration for tracking flow from a call to `strings.NewReplacer` to
124
+ * the receiver of a call to `strings.Replacer.Replace` or
125
+ * `strings.Replacer.WriteString`.
126
+ */
115
127
class StringsNewReplacerConfiguration extends DataFlow2:: Configuration {
116
128
StringsNewReplacerConfiguration ( ) { this = "StringsNewReplacerConfiguration" }
117
129
You can’t perform that action at this time.
0 commit comments