Skip to content

Commit 43ff3b1

Browse files
committed
C++: Address review comment.
1 parent 9a1b98e commit 43ff3b1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cpp/ql/src/Security/CWE/CWE-319/UseOfHttp.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ class HttpStringLiteral extends StringLiteral {
3535
exists(string s | this.getValue() = s |
3636
s = "http"
3737
or
38-
s.matches("http://%") and
39-
not s.substring(7, s.length()) instanceof PrivateHostName and
38+
exists(string tail |
39+
tail = s.regexpCapture("http://(.*)", 1) and not tail instanceof PrivateHostName
40+
) and
4041
not TaintTracking::localExprTaint(any(StringLiteral p |
4142
p.getValue() instanceof PrivateHostName
4243
), this.getParent*())

0 commit comments

Comments
 (0)