mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Apply suggestions from code review
Co-authored-by: yoff <lerchedahl@gmail.com>
This commit is contained in:
@@ -661,9 +661,7 @@ class RegexExecution extends DataFlow::Node {
|
||||
|
||||
module RegexExecution {
|
||||
abstract class Range extends DataFlow::Node {
|
||||
DataFlow::Node getRegexNode() {
|
||||
result instanceof DirectRegex or result instanceof CompiledRegex
|
||||
}
|
||||
abstract DataFlow::Node getRegexNode();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -875,7 +875,7 @@ private module Stdlib {
|
||||
}
|
||||
|
||||
/** re.ReMethod(pattern, string) */
|
||||
private class DirectRegex extends DataFlow::Node {
|
||||
private class DirectRegex extends RegexExecution::Range {
|
||||
DirectRegex() {
|
||||
exists(ReMethods reMethod, DataFlow::CallCfgNode reCall |
|
||||
reCall = API::moduleImport("re").getMember(reMethod).getACall() and
|
||||
@@ -885,7 +885,7 @@ private module Stdlib {
|
||||
}
|
||||
|
||||
/** re.compile(pattern).ReMethod */
|
||||
private class CompiledRegex extends DataFlow::Node {
|
||||
private class CompiledRegex extends RegexExecution::Range {
|
||||
CompiledRegex() {
|
||||
exists(DataFlow::CallCfgNode patternCall, DataFlow::AttrRead reMethod |
|
||||
patternCall = API::moduleImport("re").getMember("compile").getACall() and
|
||||
@@ -896,7 +896,7 @@ private module Stdlib {
|
||||
}
|
||||
}
|
||||
|
||||
private class RegexEscape extends Concepts::RegexExecution {
|
||||
private class RegexEscape extends DataFlow::Node {
|
||||
RegexEscape() {
|
||||
this =
|
||||
API::moduleImport("re").getMember("escape").getACall().(DataFlow::CallCfgNode).getArg(0)
|
||||
|
||||
Reference in New Issue
Block a user