Protect against mutability of LdapName
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / directory / ldap / DefaultLdapEntry.java
index 94ff20b03a185caa6ce5dcf111946d139cb8f94f..94e0ac46def207abecdfeb66743cbc77e45002c2 100644 (file)
@@ -74,7 +74,8 @@ public class DefaultLdapEntry implements LdapEntry {
 
        @Override
        public LdapName getDn() {
-               return dn;
+               // always return a copy since LdapName is mutable
+               return (LdapName) dn.clone();
        }
 
        public synchronized Attributes getAttributes() {