We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8962307 commit fd306edCopy full SHA for fd306ed
go/ql/src/Security/CWE-020/IncompleteHostnameRegexp.ql
@@ -81,9 +81,12 @@ predicate regexpGuardsError(RegexpPattern regexp) {
81
82
module IncompleteHostNameRegexpConfig implements DataFlow::ConfigSig {
83
additional predicate isSourceString(DataFlow::Node source, string hostPart) {
84
- exists(Expr e |
85
- e = source.asExpr() and
86
- isIncompleteHostNameRegexpPattern(e.getStringValue(), hostPart)
+ exists(Expr e | e = source.asExpr() |
+ isIncompleteHostNameRegexpPattern(e.getStringValue(), hostPart) and
+ // Exclude constant names to avoid duplicate results, because the string
87
+ // literals which they are initialised with are also considered as
88
+ // sources.
89
+ not e instanceof ConstantName
90
)
91
}
92
0 commit comments