From 1efe2ba1679169664a76d2484d41d351232c4e01 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Fri, 13 Dec 2019 19:00:54 +0100 Subject: [PATCH] inline ifStmt field --- .../javascript/security/dataflow/ExceptionXss.qll | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/javascript/ql/src/semmle/javascript/security/dataflow/ExceptionXss.qll b/javascript/ql/src/semmle/javascript/security/dataflow/ExceptionXss.qll index d7cdbab6196..af7aad3632e 100644 --- a/javascript/ql/src/semmle/javascript/security/dataflow/ExceptionXss.qll +++ b/javascript/ql/src/semmle/javascript/security/dataflow/ExceptionXss.qll @@ -67,18 +67,15 @@ module ExceptionXss { */ class Callback extends DataFlow::FunctionNode { DataFlow::ParameterNode errorParameter; - IfStmt ifStmt; Callback() { exists(DataFlow::CallNode call | call.getLastArgument().getAFunctionValue() = this) and this.getNumParameter() = 2 and errorParameter = this.getParameter(0) and - ifStmt = this.getFunction().getBodyStmt(0) and - errorParameter.flowsToExpr(ifStmt.getCondition()) and - not ifStmt.getThen().getBasicBlock().getASuccessor*() = this - .getFunction() - .getBodyStmt(1) - .getBasicBlock() + exists(IfStmt ifStmt | + ifStmt = this.getFunction().getBodyStmt(0) and + errorParameter.flowsToExpr(ifStmt.getCondition()) + ) } DataFlow::Node getErrorParam() { result = errorParameter }