Skip to content

Commit 48604cd

Browse files
Better HostnameVerificationCall.isIgnored()
1 parent 36e565d commit 48604cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

java/ql/src/experimental/Security/CWE/CWE-297/IgnoredHostnameVerification.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ private class HostnameVerificationCall extends MethodAccess {
2222

2323
/** Holds if the result of the call is not used. */
2424
predicate isIgnored() {
25-
not exists(Expr expr, IfStmt ifStmt, MethodAccess ma |
26-
this = [expr.getAChildExpr(), ifStmt.getCondition(), ma.getAnArgument()]
27-
)
25+
not exists(Expr expr | this = expr.getAChildExpr()) and
26+
not exists(IfStmt ifStmt | this = ifStmt.getCondition()) and
27+
this = any(ExprStmt es).getExpr()
2828
}
2929
}
3030

0 commit comments

Comments
 (0)