mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
Java: Fix join-order.
This commit is contained in:
@@ -2,9 +2,6 @@ import semmle.code.java.Expr
|
||||
import semmle.code.java.dataflow.SSA
|
||||
import semmle.code.java.controlflow.Guards
|
||||
|
||||
bindingset[result, i]
|
||||
private int unbindInt(int i) { i <= result and i >= result }
|
||||
|
||||
/** Holds if the method `method` validates its `arg`-th argument in some way. */
|
||||
predicate validationMethod(Method method, int arg) {
|
||||
// The method examines the contents of the string argument.
|
||||
@@ -22,8 +19,8 @@ predicate validationMethod(Method method, int arg) {
|
||||
// The method calls another one that verifies the argument.
|
||||
exists(Parameter param, MethodAccess call, int recursiveArg |
|
||||
method.getParameter(arg) = param and
|
||||
call.getArgument(recursiveArg) = param.getAnAccess() and
|
||||
validationMethod(call.getMethod(), unbindInt(recursiveArg))
|
||||
call.getArgument(pragma[only_bind_into](recursiveArg)) = param.getAnAccess() and
|
||||
validationMethod(pragma[only_bind_into](call.getMethod()), pragma[only_bind_into](recursiveArg))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user