mirror of
https://github.com/github/codeql.git
synced 2025-12-21 03:06:31 +01:00
move StdLibRegExpInterpretation to Stdlib.qll
This commit is contained in:
@@ -3015,6 +3015,19 @@ private module StdlibPrivate {
|
||||
override string getKind() { result = Escaping::getRegexKind() }
|
||||
}
|
||||
|
||||
private import semmle.python.regex as Regex
|
||||
|
||||
/**
|
||||
* A node interpreted as a regular expression.
|
||||
* Speficically nodes where string values are interpreted as regular expressions.
|
||||
*/
|
||||
class StdLibRegExpInterpretation extends Regex::RegExpInterpretation::Range {
|
||||
StdLibRegExpInterpretation() {
|
||||
this =
|
||||
API::moduleImport("re").getMember("compile").getACall().getParameter(0, "pattern").asSink()
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// urllib
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -4,6 +4,7 @@ private import semmle.python.Frameworks
|
||||
private import regexp.internal.RegExpTracking as RegExpTracking
|
||||
private import semmle.python.Concepts as Concepts
|
||||
private import semmle.python.regexp.RegexTreeView
|
||||
private import semmle.python.dataflow.new.DataFlow
|
||||
import regexp.internal.ParseRegExp
|
||||
|
||||
/** Gets a parsed regular expression term that is executed at `exec`. */
|
||||
@@ -24,19 +25,6 @@ module RegExpInterpretation {
|
||||
abstract class Range extends DataFlow::Node { }
|
||||
}
|
||||
|
||||
private import semmle.python.ApiGraphs
|
||||
|
||||
/**
|
||||
* A node interpreted as a regular expression.
|
||||
* Speficically nodes where string values are interpreted as regular expressions.
|
||||
*/
|
||||
class StdLibRegExpInterpretation extends RegExpInterpretation::Range {
|
||||
StdLibRegExpInterpretation() {
|
||||
this =
|
||||
API::moduleImport("re").getMember("compile").getACall().getParameter(0, "pattern").asSink()
|
||||
}
|
||||
}
|
||||
|
||||
/** A StrConst used as a regular expression */
|
||||
deprecated class RegexString extends Regex {
|
||||
RegexString() { this = RegExpTracking::regExpSource(_).asExpr() }
|
||||
|
||||
Reference in New Issue
Block a user