mirror of
https://github.com/github/codeql.git
synced 2025-12-24 12:46:34 +01:00
add String type startsWith
This commit is contained in:
@@ -52,11 +52,13 @@ private class CompareSink extends UseOfLessTrustedSink {
|
||||
)
|
||||
or
|
||||
exists(MethodAccess ma |
|
||||
ma.getMethod().hasName("contains") and
|
||||
ma.getMethod().getName() in ["contains", "startsWith"] and
|
||||
ma.getMethod().getDeclaringType() instanceof TypeString and
|
||||
ma.getMethod().getNumberOfParameters() = 1 and
|
||||
ma.getQualifier() = this.asExpr() and
|
||||
not ma.getArgument(0).(CompileTimeConstantExpr).getStringValue().toLowerCase() in ["", "unknown"]
|
||||
not ma.getArgument(0).(CompileTimeConstantExpr).getStringValue().toLowerCase() in [
|
||||
"", "unknown"
|
||||
]
|
||||
)
|
||||
or
|
||||
exists(MethodAccess ma |
|
||||
|
||||
Reference in New Issue
Block a user