Skip to content

Commit 813df9e

Browse files
committed
Fix Concepts.qll conflict
1 parent 37d6ff7 commit 813df9e

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

python/ql/src/experimental/semmle/python/Concepts.qll

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,73 @@ private import semmle.python.dataflow.new.RemoteFlowSources
1414
private import semmle.python.dataflow.new.TaintTracking
1515
private import experimental.semmle.python.Frameworks
1616

17+
/** Provides classes for modeling Regular Expression-related APIs. */
18+
module RegexExecution {
19+
/**
20+
* A data-flow node that executes a regular expression.
21+
*
22+
* Extend this class to model new APIs. If you want to refine existing API models,
23+
* extend `RegexExecution` instead.
24+
*/
25+
abstract class Range extends DataFlow::Node {
26+
/**
27+
* Gets the argument containing the executed expression.
28+
*/
29+
abstract DataFlow::Node getRegexNode();
30+
31+
/**
32+
* Gets the library used to execute the regular expression.
33+
*/
34+
abstract string getRegexModule();
35+
}
36+
}
37+
38+
/**
39+
* A data-flow node that executes a regular expression.
40+
*
41+
* Extend this class to refine existing API models. If you want to model new APIs,
42+
* extend `RegexExecution::Range` instead.
43+
*/
44+
class RegexExecution extends DataFlow::Node {
45+
RegexExecution::Range range;
46+
47+
RegexExecution() { this = range }
48+
49+
DataFlow::Node getRegexNode() { result = range.getRegexNode() }
50+
51+
string getRegexModule() { result = range.getRegexModule() }
52+
}
53+
54+
/** Provides classes for modeling Regular Expression escape-related APIs. */
55+
module RegexEscape {
56+
/**
57+
* A data-flow node that escapes a regular expression.
58+
*
59+
* Extend this class to model new APIs. If you want to refine existing API models,
60+
* extend `RegexEscape` instead.
61+
*/
62+
abstract class Range extends DataFlow::Node {
63+
/**
64+
* Gets the argument containing the escaped expression.
65+
*/
66+
abstract DataFlow::Node getRegexNode();
67+
}
68+
}
69+
70+
/**
71+
* A data-flow node that escapes a regular expression.
72+
*
73+
* Extend this class to refine existing API models. If you want to model new APIs,
74+
* extend `RegexEscape::Range` instead.
75+
*/
76+
class RegexEscape extends DataFlow::Node {
77+
RegexEscape::Range range;
78+
79+
RegexEscape() { this = range }
80+
81+
DataFlow::Node getRegexNode() { result = range.getRegexNode() }
82+
}
83+
1784
/** Provides classes for modeling LDAP query execution-related APIs. */
1885
module LDAPQuery {
1986
/**

0 commit comments

Comments
 (0)