Skip to content

Commit ac805f0

Browse files
committed
Ruby: simplify predicate by using DataFlow::CallNode
1 parent ca4dc05 commit ac805f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ruby/ql/src/queries/security/cwe-116/IncompleteSanitization.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ predicate removesFirstOccurence(StringSubstitutionCall sub, string str) {
124124
* Gets a method call where the receiver is the result of a string substitution
125125
* call.
126126
*/
127-
DataFlow::Node getAMethodCall(StringSubstitutionCall call) {
127+
DataFlow::CallNode getAMethodCall(StringSubstitutionCall call) {
128128
exists(DataFlow::Node receiver |
129-
receiver.asExpr() = result.asExpr().(ExprNodes::MethodCallCfgNode).getReceiver() and
129+
receiver = result.getReceiver() and
130130
(
131131
// for a non-destructive string substitution, is there flow from it to the
132132
// receiver of another method call?

0 commit comments

Comments
 (0)