mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
Java: Remove superfluous clone models.
This commit is contained in:
@@ -316,9 +316,6 @@ private predicate qualifierToMethodStep(Expr tracked, MethodCall sink, string mo
|
||||
* Methods that return tainted data when called on tainted data.
|
||||
*/
|
||||
private predicate taintPreservingQualifierToMethod(Method m, string model) {
|
||||
model = "" and
|
||||
m instanceof CloneMethod
|
||||
or
|
||||
model = "%StringWriter" and
|
||||
m.getDeclaringType().getQualifiedName().matches("%StringWriter") and
|
||||
(
|
||||
|
||||
@@ -44,8 +44,12 @@ class MethodLdapNameAddAll extends Method {
|
||||
}
|
||||
}
|
||||
|
||||
/** A method with the name `clone` declared in `javax.naming.ldap.LdapName`. */
|
||||
class MethodLdapNameClone extends Method {
|
||||
/**
|
||||
* DEPRECATED: No longer needed as clone steps are handled uniformly.
|
||||
*
|
||||
* A method with the name `clone` declared in `javax.naming.ldap.LdapName`.
|
||||
*/
|
||||
deprecated class MethodLdapNameClone extends Method {
|
||||
MethodLdapNameClone() {
|
||||
this.getDeclaringType() instanceof TypeLdapName and
|
||||
this.hasName("clone")
|
||||
|
||||
@@ -62,7 +62,7 @@ private predicate ldapNameAddAllStep(DataFlow::ExprNode n1, DataFlow::ExprNode n
|
||||
|
||||
/**
|
||||
* Holds if `n1` to `n2` is a dataflow step that converts between `LdapName` and `LdapName` or
|
||||
* `String`, i.e. `taintedLdapName.clone()`, `taintedLdapName.getAll()`,
|
||||
* `String`, i.e. `taintedLdapName.getAll()`,
|
||||
* `taintedLdapName.getRdns()` or `taintedLdapName.toString()`.
|
||||
*/
|
||||
private predicate ldapNameGetCloneStep(DataFlow::ExprNode n1, DataFlow::ExprNode n2) {
|
||||
@@ -71,7 +71,6 @@ private predicate ldapNameGetCloneStep(DataFlow::ExprNode n1, DataFlow::ExprNode
|
||||
n2.asExpr() = ma and
|
||||
ma.getMethod() = m
|
||||
|
|
||||
m instanceof MethodLdapNameClone or
|
||||
m instanceof MethodLdapNameGetAll or
|
||||
m instanceof MethodLdapNameGetRdns or
|
||||
m instanceof MethodLdapNameToString
|
||||
|
||||
Reference in New Issue
Block a user