Skip to content

Commit 52d4655

Browse files
committed
Ruby: fix 'inefficient string comparison' alert
1 parent 95bf18f commit 52d4655

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ruby/ql/lib/codeql/ruby/security/HardcodedDataInterpretedAsCodeCustomizations.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module HardcodedDataInterpretedAsCode {
7979
forex(StringComponentCfgNode c |
8080
c = this.asExpr().(ExprNodes::StringlikeLiteralCfgNode).getAComponent()
8181
|
82-
c.getNode().(AST::StringEscapeSequenceComponent).getRawText().prefix(2) = "\\x"
82+
c.getNode().(AST::StringEscapeSequenceComponent).getRawText().matches("\\x%")
8383
)
8484
}
8585
}

0 commit comments

Comments
 (0)