Skip to content

Commit 4e261c6

Browse files
committed
Optimize concatAndCompareAgainstFullHostRegex
1 parent 8008011 commit 4e261c6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

python/ql/src/experimental/semmle/python/security/LDAPInsecureAuth.qll

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,8 @@ class LDAPPrivateHost extends StrConst {
3838
}
3939

4040
predicate concatAndCompareAgainstFullHostRegex(LDAPSchema schema, StrConst host) {
41-
schema instanceof LDAPSchema and
4241
not host instanceof LDAPPrivateHost and
43-
exists(string full_host |
44-
full_host = schema.(StrConst).getText() + host.(StrConst).getText() and
45-
full_host.regexpMatch(getFullHostRegex())
46-
)
42+
(schema.getText() + host.getText()).regexpMatch(getFullHostRegex())
4743
}
4844

4945
// "ldap://" + "somethingon.theinternet.com"

0 commit comments

Comments
 (0)