diff --git a/ql/src/Security/CWE-020/SuspiciousCharacterInRegexp.go b/ql/src/Security/CWE-020/SuspiciousCharacterInRegexp.go index 6df71046833..0a4b8a90794 100644 --- a/ql/src/Security/CWE-020/SuspiciousCharacterInRegexp.go +++ b/ql/src/Security/CWE-020/SuspiciousCharacterInRegexp.go @@ -3,8 +3,8 @@ package main import "regexp" func broken(hostNames []byte) string { - var htmlRe = regexp.MustCompile("\bforbidden.host.org") - if htmlRe.Match(hostNames) { + var hostRe = regexp.MustCompile("\bforbidden.host.org") + if hostRe.Match(hostNames) { return "Must not target forbidden.host.org" } else { // This will be reached even if hostNames is exactly "forbidden.host.org", diff --git a/ql/src/Security/CWE-020/SuspiciousCharacterInRegexpGood.go b/ql/src/Security/CWE-020/SuspiciousCharacterInRegexpGood.go index c66f0068c41..a311e66af8d 100644 --- a/ql/src/Security/CWE-020/SuspiciousCharacterInRegexpGood.go +++ b/ql/src/Security/CWE-020/SuspiciousCharacterInRegexpGood.go @@ -3,8 +3,8 @@ package main import "regexp" func fixed(hostNames []byte) string { - var htmlRe = regexp.MustCompile("\\bforbidden.host.org") - if htmlRe.Match(hostNames) { + var hostRe = regexp.MustCompile("\\bforbidden.host.org") + if hostRe.Match(hostNames) { return "Must not target forbidden.host.org" } else { // hostNames definitely doesn't contain a word "forbidden.host.org", as "\\b"