Skip to content

Commit 9b4442b

Browse files
committed
Fix some errors
1 parent 4543247 commit 9b4442b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

java/ql/src/experimental/Security/CWE/CWE-348/UseOfLessTrustedSourceLib.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,27 @@ private class CompareSink extends UseOfLessTrustedSink {
5656
ma.getMethod().getDeclaringType() instanceof TypeString and
5757
ma.getMethod().getNumberOfParameters() = 1 and
5858
ma.getQualifier() = this.asExpr() and
59-
ma.getArgument(0).(CompileTimeConstantExpr).getStringValue().toLowerCase() in ["", "unknown"]
59+
not ma.getArgument(0).(CompileTimeConstantExpr).getStringValue().toLowerCase() in ["", "unknown"]
6060
)
6161
or
62-
exists(MethodAccess ma, int i |
62+
exists(MethodAccess ma |
6363
ma.getMethod().hasName("startsWith") and
6464
ma.getMethod()
6565
.getDeclaringType()
6666
.hasQualifiedName(["org.apache.commons.lang3", "org.apache.commons.lang"], "StringUtils") and
6767
ma.getMethod().getNumberOfParameters() = 2 and
68-
ma.getArgument(i) = this.asExpr() and
69-
ma.getArgument(1 - i).(CompileTimeConstantExpr).getStringValue() != ""
68+
ma.getAnArgument() = this.asExpr() and
69+
ma.getAnArgument().(CompileTimeConstantExpr).getStringValue() != ""
7070
)
7171
or
72-
exists(MethodAccess ma, int i |
72+
exists(MethodAccess ma |
7373
ma.getMethod().getName() in ["equals", "equalsIgnoreCase"] and
7474
ma.getMethod()
7575
.getDeclaringType()
7676
.hasQualifiedName(["org.apache.commons.lang3", "org.apache.commons.lang"], "StringUtils") and
7777
ma.getMethod().getNumberOfParameters() = 2 and
78-
ma.getArgument(i) = this.asExpr() and
79-
not ma.getArgument(1 - i).(CompileTimeConstantExpr).getStringValue().toLowerCase() in [
78+
ma.getAnArgument() = this.asExpr() and
79+
not ma.getAnArgument().(CompileTimeConstantExpr).getStringValue().toLowerCase() in [
8080
"", "unknown", ":"
8181
]
8282
)

0 commit comments

Comments
 (0)