move StdLibRegExpInterpretation to Stdlib.qll

This commit is contained in:
erik-krogh
2023-03-24 12:14:29 +01:00
parent a64848c022
commit 2fad406b5c
2 changed files with 14 additions and 13 deletions

View File

@@ -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
// ---------------------------------------------------------------------------

View File

@@ -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() }