Skip to content

Commit 1efe2ba

Browse files
committed
inline ifStmt field
1 parent 3b2cc46 commit 1efe2ba

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

javascript/ql/src/semmle/javascript/security/dataflow/ExceptionXss.qll

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,15 @@ module ExceptionXss {
6767
*/
6868
class Callback extends DataFlow::FunctionNode {
6969
DataFlow::ParameterNode errorParameter;
70-
IfStmt ifStmt;
7170

7271
Callback() {
7372
exists(DataFlow::CallNode call | call.getLastArgument().getAFunctionValue() = this) and
7473
this.getNumParameter() = 2 and
7574
errorParameter = this.getParameter(0) and
76-
ifStmt = this.getFunction().getBodyStmt(0) and
77-
errorParameter.flowsToExpr(ifStmt.getCondition()) and
78-
not ifStmt.getThen().getBasicBlock().getASuccessor*() = this
79-
.getFunction()
80-
.getBodyStmt(1)
81-
.getBasicBlock()
75+
exists(IfStmt ifStmt |
76+
ifStmt = this.getFunction().getBodyStmt(0) and
77+
errorParameter.flowsToExpr(ifStmt.getCondition())
78+
)
8279
}
8380

8481
DataFlow::Node getErrorParam() { result = errorParameter }

0 commit comments

Comments
 (0)