mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Autoformat
This commit is contained in:
@@ -15,9 +15,7 @@ import java
|
||||
|
||||
class SpecialCollectionCreation extends MethodCall {
|
||||
SpecialCollectionCreation() {
|
||||
exists(Method m, RefType rt |
|
||||
m = this.(MethodCall).getCallee() and rt = m.getDeclaringType()
|
||||
|
|
||||
exists(Method m, RefType rt | m = this.(MethodCall).getCallee() and rt = m.getDeclaringType() |
|
||||
rt.hasQualifiedName("java.util", "Arrays") and m.hasName("asList")
|
||||
or
|
||||
rt.hasQualifiedName("java.util", "Collections") and
|
||||
|
||||
@@ -32,9 +32,7 @@ where
|
||||
v instanceof LocalVariableDecl and exists(ReturnStmt ret | ret.getResult() = va)
|
||||
or
|
||||
// ...or a call to a query method on `v`.
|
||||
exists(MethodCall ma | va = ma.getQualifier() |
|
||||
ma.getMethod() instanceof ContainerQueryMethod
|
||||
)
|
||||
exists(MethodCall ma | va = ma.getQualifier() | ma.getMethod() instanceof ContainerQueryMethod)
|
||||
) and
|
||||
// There is at least one call to a query method.
|
||||
exists(MethodCall ma | v.getAnAccess() = ma.getQualifier() |
|
||||
|
||||
@@ -30,9 +30,7 @@ predicate locallySynchronized(MethodCall ma) {
|
||||
predicate hasUnsynchronizedCall(Method m) {
|
||||
m.isPublic() and not m.isSynchronized()
|
||||
or
|
||||
exists(MethodCall ma, Method caller |
|
||||
ma.getMethod() = m and caller = ma.getEnclosingCallable()
|
||||
|
|
||||
exists(MethodCall ma, Method caller | ma.getMethod() = m and caller = ma.getEnclosingCallable() |
|
||||
hasUnsynchronizedCall(caller) and
|
||||
not caller.isSynchronized() and
|
||||
not locallySynchronized(ma)
|
||||
|
||||
@@ -25,9 +25,7 @@ import semmle.code.java.security.TempDirLocalInformationDisclosureQuery
|
||||
* resulting in a zero-length paths.
|
||||
*/
|
||||
module InsecureMethodPathGraph implements DataFlow::PathGraphSig<MethodCallInsecureFileCreation> {
|
||||
predicate edges(MethodCallInsecureFileCreation n1, MethodCallInsecureFileCreation n2) {
|
||||
none()
|
||||
}
|
||||
predicate edges(MethodCallInsecureFileCreation n1, MethodCallInsecureFileCreation n2) { none() }
|
||||
|
||||
predicate nodes(MethodCallInsecureFileCreation n, string key, string val) {
|
||||
key = "semmle.label" and val = n.toString()
|
||||
|
||||
@@ -18,8 +18,7 @@ import semmle.code.java.security.ConditionalBypassQuery
|
||||
import ConditionalBypassFlow::PathGraph
|
||||
|
||||
from
|
||||
ConditionalBypassFlow::PathNode source, ConditionalBypassFlow::PathNode sink, MethodCall m,
|
||||
Expr e
|
||||
ConditionalBypassFlow::PathNode source, ConditionalBypassFlow::PathNode sink, MethodCall m, Expr e
|
||||
where
|
||||
conditionControlsMethod(m, e) and
|
||||
sink.getNode().asExpr() = e and
|
||||
|
||||
@@ -155,9 +155,7 @@ predicate inDifferentRunnables(MethodCall ma1, MethodCall ma2) {
|
||||
* in statement `inner` that is qualified by one of the parameters of `outer`, and there is
|
||||
* another access to `outer` that may cause locking to be performed in a different order.
|
||||
*/
|
||||
predicate badMethodCallLockOrder(
|
||||
MethodCall outerAccess, MethodCall innerAccess, MethodCall other
|
||||
) {
|
||||
predicate badMethodCallLockOrder(MethodCall outerAccess, MethodCall innerAccess, MethodCall other) {
|
||||
exists(Synched outer, Synched inner |
|
||||
inner = innerAccess and
|
||||
inner = outer.getInnerSynch() and
|
||||
|
||||
@@ -91,9 +91,7 @@ predicate exprHasNoEffect(Expr e) {
|
||||
constructorHasEffect(c)
|
||||
)
|
||||
or
|
||||
exists(MethodCall ma, Method m |
|
||||
bad = ma and m = ma.getMethod().getAPossibleImplementation()
|
||||
|
|
||||
exists(MethodCall ma, Method m | bad = ma and m = ma.getMethod().getAPossibleImplementation() |
|
||||
methodHasEffect(m) or not m.fromSource()
|
||||
)
|
||||
)
|
||||
|
||||
@@ -56,9 +56,7 @@ private module BindingUnsafeRemoteObjectConfig implements DataFlow::ConfigSig {
|
||||
}
|
||||
|
||||
predicate isSink(DataFlow::Node sink) {
|
||||
exists(MethodCall ma | ma.getArgument(1) = sink.asExpr() |
|
||||
ma.getMethod() instanceof BindMethod
|
||||
)
|
||||
exists(MethodCall ma | ma.getArgument(1) = sink.asExpr() | ma.getMethod() instanceof BindMethod)
|
||||
}
|
||||
|
||||
predicate isAdditionalFlowStep(DataFlow::Node fromNode, DataFlow::Node toNode) {
|
||||
|
||||
@@ -117,9 +117,7 @@ predicate hasHashAncestor(MethodCall ma) {
|
||||
}
|
||||
|
||||
/** Holds if `MethodCall` ma is a hashing call without a sibling node making another hashing call. */
|
||||
predicate isSingleHashMethodCall(MethodCall ma) {
|
||||
isHashAccess(ma) and not hasAnotherHashCall(ma)
|
||||
}
|
||||
predicate isSingleHashMethodCall(MethodCall ma) { isHashAccess(ma) and not hasAnotherHashCall(ma) }
|
||||
|
||||
/** Holds if `MethodCall` ma is a single hashing call that is not invoked by a wrapper method. */
|
||||
predicate isSink(MethodCall ma) { isSingleHashMethodCall(ma) and not hasHashAncestor(ma) }
|
||||
|
||||
Reference in New Issue
Block a user