Skip to content

Commit 695e77a

Browse files
committed
Simplify isSslSocket predicate
1 parent e442e50 commit 695e77a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

java/ql/lib/semmle/code/java/security/UnsafeCertTrust.qll

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,7 @@ private class SslEngineServerMode extends SslUnsafeCertTrustSanitizer {
6969
* or the qualifier of `createSocket` is an instance of `SSLSocketFactory`.
7070
*/
7171
private predicate isSslSocket(MethodAccess createSocket) {
72-
exists(Variable ssl, CastExpr ce |
73-
ce.getExpr() = createSocket and
74-
ce.getControlFlowNode().getASuccessor().(VariableAssign).getDestVar() = ssl and
75-
ssl.getType() instanceof SSLSocket
76-
)
72+
createSocket = any(CastExpr ce | ce.getType() instanceof SSLSocket).getExpr()
7773
or
7874
createSocket.getQualifier().getType().(RefType).getASupertype*() instanceof SSLSocketFactory
7975
}

0 commit comments

Comments
 (0)