Covered copyOfRange() and clone() in ArrayUpdate

This commit is contained in:
Fosstars
2021-08-14 13:25:46 +02:00
parent d218813320
commit e2dc9753ac

View File

@@ -51,7 +51,7 @@ private class ArrayUpdate extends Expr {
)
or
exists(StaticMethodAccess ma |
ma.getMethod().hasQualifiedName("java.util", "Arrays", "copyOf") and
ma.getMethod().hasQualifiedName("java.util", "Arrays", ["copyOf", "copyOfRange"]) and
ma = this and
ma = array
)
@@ -66,6 +66,10 @@ private class ArrayUpdate extends Expr {
m.hasQualifiedName("java.security", "SecureRandom", "nextBytes") or
m.hasQualifiedName("java.util", "Random", "nextBytes")
)
or
exists(MethodAccess ma, Method m | m = ma.getMethod() |
m.getDeclaringType().hasName("byte[]") and m.hasName("clone") and ma = this and ma = array
)
}
/** Returns the updated array. */