[Date Prev][Date Next] [Chronological] [Thread] [Top]

[JLDAP] Casting error in com.novell.ldap.LDAPSearchConstraints (ITS#2688)



Full_Name: Geoffrey Elgey
Version: JLDAP
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (202.83.95.124)


The com.novell.ldap.LDAPSearchConstraints class has a casting error in one of
the constructors when cloning. 

The object being cloned is of type LDAPControl[], but the cast is (LDAPControl)
rather than (LDAPControl[]).

See patch for suggested fix:

@@ -116,7 +116,7 @@
                     cons.getReferralHandler(), cons.getHopLimit());
         LDAPControl[] lsc = cons.getControls();
         if( lsc != null) {
-            super.setControls((LDAPControl)lsc.clone());
+            super.setControls((LDAPControl[])lsc.clone());
         }
         Hashtable lp = cons.getProperties();
         if( lp != null) {