From e92738a93fa493a1245f7acd8a524bb254a04277 Mon Sep 17 00:00:00 2001 From: Slavomir Date: Fri, 16 Jul 2021 00:42:36 +0300 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Chris Smowton --- ql/src/experimental/CWE-942/CorsMisconfiguration.ql | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ql/src/experimental/CWE-942/CorsMisconfiguration.ql b/ql/src/experimental/CWE-942/CorsMisconfiguration.ql index bd6297afb92..17f9dd54753 100644 --- a/ql/src/experimental/CWE-942/CorsMisconfiguration.ql +++ b/ql/src/experimental/CWE-942/CorsMisconfiguration.ql @@ -122,11 +122,9 @@ class FlowsFromUntrusted extends TaintTracking::Configuration { predicate isSink(DataFlow::Node sink, ControlFlow::ConditionGuardNode cgn) { exists(IfStmt ifs | - exists(Expr child, Expr operand | - child = ifs.getCond().getAChildExpr*() and - operand = child and + exists(Expr operand | + operand = ifs.getCond().getAChildExpr*() and ( - // exists(DataFlow::CallExpr call | call = operand | call.getTarget().hasQualifiedName("strings", "HasSuffix") and sink.asExpr() = call.getArgument(0)