]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/oc.c
Fix corrupted CSN issue
[openldap] / servers / slapd / oc.c
index 7fa10b01771c3292a60c56909aab9f558d44fcb6..3ba9501db39cea3f71c32f17f830b25ba21cf897 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2008 The OpenLDAP Foundation.
+ * Copyright 1998-2009 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -92,6 +92,9 @@ int is_entry_objectclass(
                        e->e_dn == NULL ? "" : e->e_dn,
                        oc->soc_oclass.oc_oid, 0 );
 
+               /* mark flags as set */
+               e->e_ocflags |= SLAP_OC__END;
+
                return 0;
        }
 
@@ -227,6 +230,7 @@ oc_bvfind_undef( struct berval *ocname )
        oc->soc_cname.bv_len = ocname->bv_len;
        oc->soc_cname.bv_val = (char *)&oc[ 1 ];
        AC_MEMCPY( oc->soc_cname.bv_val, ocname->bv_val, ocname->bv_len );
+       oc->soc_cname.bv_val[ oc->soc_cname.bv_len ] = '\0';
 
        /* canonical to upper case */
        ldap_pvt_str2upper( oc->soc_cname.bv_val );