mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Covered copyOfRange() and clone() in ArrayUpdate
This commit is contained in:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user