Skip to content

Commit 1a41688

Browse files
committed
C++: Do something similar with the other three cases.
1 parent 316117f commit 1a41688

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

cpp/ql/src/Security/CWE/CWE-290/AuthenticationBypass.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ predicate hardCodedAddressOrIP(StringLiteral txt) {
3131
// Hard-coded ip addresses, such as 127.0.0.1
3232
s.regexpMatch("\"[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+\"") or
3333
// Hard-coded addresses such as www.mycompany.com
34-
s.matches("\"www.%\"") or
35-
s.matches("\"http:%\"") or
36-
s.matches("\"https:%\"") or
34+
s.regexpMatch("\"(www\\.|http:|https:).*\"") or
3735
s.regexpMatch("\".*\\.(" + concat(getATopLevelDomain(), "|") + ")\"")
3836
)
3937
}

0 commit comments

Comments
 (0)