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 {
106106 override Quote getQuote() { result = quote }
107107 }
108108
109+ /**
110+ * A call to `strings.NewReplacer`.
111+ */
109112 class StringsNewReplacerCall extends DataFlow::CallNode {
110113 StringsNewReplacerCall() { this.getTarget().hasQualifiedName("strings", "NewReplacer") }
111114
115+ /**
116+ * Gets an argument to this call corresponding to a string that will be
117+ * replaced.
118+ */
112119 DataFlow::Node getAReplacedArgument() { exists(int n | n % 2 = 0 and result = getArgument(n)) }
113120 }
114121
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+ */
115127 class StringsNewReplacerConfiguration extends DataFlow2::Configuration {
116128 StringsNewReplacerConfiguration() { this = "StringsNewReplacerConfiguration" }
117129
You can’t perform that action at this time.
0 commit comments