File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
ruby/ql/lib/codeql/ruby/security/performance Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -48,12 +48,16 @@ module RegExpInjection {
4848 }
4949
5050 /**
51- * The first argument of a call to `Regexp.new`, considered as a flow sink.
51+ * The first argument of a call to `Regexp.new` or `Regexp.compile`,
52+ * considered as a flow sink.
5253 */
5354 class ConstructedRegExpAsSink extends Sink {
5455 ConstructedRegExpAsSink ( ) {
55- this =
56- API:: getTopLevelMember ( "Regexp" ) .getAnInstantiation ( ) .( DataFlow:: CallNode ) .getArgument ( 0 )
56+ exists ( API:: Node regexp , DataFlow:: CallNode callNode |
57+ regexp = API:: getTopLevelMember ( "Regexp" ) and
58+ ( callNode = regexp .getAnInstantiation ( ) or callNode = regexp .getAMethodCall ( "compile" ) ) and
59+ this = callNode .getArgument ( 0 )
60+ )
5761 }
5862 }
5963
You can’t perform that action at this time.
0 commit comments