Skip to content

Commit 13d1c88

Browse files
committed
Make new data flow copy for StringOps.StringsNewReplacer
1 parent 3fda9f6 commit 13d1c88

File tree

4 files changed

+4910
-1
lines changed

4 files changed

+4910
-1
lines changed

config/identical-files.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplForContentDataFlow.qll",
3030
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl.qll",
3131
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl2.qll",
32+
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImplForStringsNewReplacer.qll",
3233
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl.qll",
3334
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl2.qll",
3435
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl3.qll",

go/ql/lib/semmle/go/StringOps.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
import go
6+
import semmle.go.dataflow.DataFlowForStringsNewReplacer
67

78
/** Provides predicates and classes for working with string operations. */
89
module StringOps {
@@ -227,7 +228,7 @@ module StringOps {
227228
* the receiver of a call to `strings.Replacer.Replace` or
228229
* `strings.Replacer.WriteString`.
229230
*/
230-
private class StringsNewReplacerConfiguration extends DataFlow2::Configuration {
231+
private class StringsNewReplacerConfiguration extends DataFlowForStringsNewReplacer::Configuration {
231232
StringsNewReplacerConfiguration() { this = "StringsNewReplacerConfiguration" }
232233

233234
override predicate isSource(DataFlow::Node source) {
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* Provides a library for local (intra-procedural) and global (inter-procedural)
3+
* data flow analysis: deciding whether data can flow from a _source_ to a
4+
* _sink_.
5+
*
6+
* Unless configured otherwise, _flow_ means that the exact value of
7+
* the source may reach the sink. We do not track flow across pointer
8+
* dereferences or array indexing. To track these types of flow, where the
9+
* exact value may not be preserved, import
10+
* `semmle.code.go.dataflow.TaintTracking`.
11+
*
12+
* To use global (interprocedural) data flow, extend the class
13+
* `DataFlow::Configuration` as documented on that class. To use local
14+
* (intraprocedural) data flow, invoke `DataFlow::localFlow` or
15+
* `DataFlow::LocalFlowStep` with arguments of type `DataFlow::Node`.
16+
*/
17+
18+
import go
19+
20+
/**
21+
* Provides a library for local (intra-procedural) and global (inter-procedural)
22+
* data flow analysis.
23+
*/
24+
module DataFlowForStringsNewReplacer {
25+
import semmle.go.dataflow.internal.DataFlowImplForStringsNewReplacer
26+
import Properties
27+
}

0 commit comments

Comments
 (0)