Skip to content

Commit e37336d

Browse files
authored
No need for getUnderlyingExpr to look through casts
1 parent d2fc6a7 commit e37336d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

java/ql/lib/semmle/code/java/security/SensitiveLoggingQuery.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private predicate singleArgLimit(MethodCall mc, int limit, boolean isKotlin) {
9090
exists(int firstArgIndex, int delta |
9191
if isKotlin = true then firstArgIndex = 1 else firstArgIndex = 0
9292
|
93-
bounded(mc.getArgument(firstArgIndex).getUnderlyingExpr(), any(ZeroBound z), delta, true, _) and
93+
bounded(mc.getArgument(firstArgIndex), any(ZeroBound z), delta, true, _) and
9494
delta <= limit
9595
)
9696
}
@@ -104,10 +104,10 @@ private predicate twoArgLimit(MethodCall mc, int limit, boolean isKotlin) {
104104
or
105105
isKotlin = false and firstArgIndex = 0 and secondArgIndex = 1
106106
|
107-
// mc.getArgument(firstArgIndex).getUnderlyingExpr().(CompileTimeConstantExpr).getIntValue() = 0 and
108-
bounded(mc.getArgument(firstArgIndex).getUnderlyingExpr(), any(ZeroBound z), 0, true, _) and
109-
bounded(mc.getArgument(firstArgIndex).getUnderlyingExpr(), any(ZeroBound z), 0, false, _) and
110-
bounded(mc.getArgument(secondArgIndex).getUnderlyingExpr(), any(ZeroBound z), delta, true, _) and
107+
// mc.getArgument(firstArgIndex).(CompileTimeConstantExpr).getIntValue() = 0 and
108+
bounded(mc.getArgument(firstArgIndex), any(ZeroBound z), 0, true, _) and
109+
bounded(mc.getArgument(firstArgIndex), any(ZeroBound z), 0, false, _) and
110+
bounded(mc.getArgument(secondArgIndex), any(ZeroBound z), delta, true, _) and
111111
delta <= limit
112112
)
113113
}

0 commit comments

Comments
 (0)