Autoformat

This commit is contained in:
Chris Smowton
2023-10-24 11:06:19 +01:00
parent 09e83d1173
commit e8c9708282
24 changed files with 26 additions and 65 deletions

View File

@@ -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

View File

@@ -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() |

View File

@@ -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)

View File

@@ -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()

View File

@@ -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

View File

@@ -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

View File

@@ -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()
)
)

View File

@@ -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) {

View File

@@ -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) }