mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Crypto: To get unreferenced parameters as general sources for Java, I've included the caveat that if a function is called, all the calls appear to be in test files.
This commit is contained in:
@@ -55,7 +55,18 @@ final class DefaultRemoteFlowSource = RemoteFlowSource;
|
||||
|
||||
private class GenericUnreferencedParameterSource extends Crypto::GenericUnreferencedParameterSource {
|
||||
GenericUnreferencedParameterSource() {
|
||||
exists(Parameter p | this = p and not exists(p.getAnArgument()))
|
||||
exists(Parameter p |
|
||||
this = p and
|
||||
(
|
||||
not exists(p.getAnArgument())
|
||||
or
|
||||
// If all calls to a function occur in a test file, ignore those calls
|
||||
// and consider the parameter to the function a potential source as well.
|
||||
forall(Call testCall | testCall.getCallee() = p.getCallable() |
|
||||
testCall.getFile().getBaseName().toUpperCase().matches("%TEST%")
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override predicate flowsTo(Crypto::FlowAwareElement other) {
|
||||
|
||||
Reference in New Issue
Block a user