]> git.sur5r.net Git - openldap/commitdiff
ITS#7540 reject undefined attrs
authorHoward Chu <hyc@openldap.org>
Tue, 19 Mar 2013 20:32:42 +0000 (13:32 -0700)
committerHoward Chu <hyc@openldap.org>
Tue, 19 Mar 2013 20:32:42 +0000 (13:32 -0700)
servers/slapd/back-mdb/id2entry.c

index 9e6f840e8029087197ffbaf70917c4d4673d7515..d3d238f35332d156dea917ca16635571b8d57f96 100644 (file)
@@ -72,7 +72,7 @@ again:
        if (rc == MDB_SUCCESS) {
                rc = mdb_entry_encode( op, e, &data, &ec );
                if( rc != LDAP_SUCCESS )
-                       return LDAP_OTHER;
+                       return rc;
        }
        if (rc) {
                /* Was there a hole from slapadd? */
@@ -600,6 +600,8 @@ static int mdb_entry_encode(Operation *op, Entry *e, MDB_val *data, Ecount *eh)
        ptr = (unsigned char *)(lp + eh->offset);
 
        for (a=e->e_attrs; a; a=a->a_next) {
+               if (!a->a_desc->ad_index)
+                       return LDAP_UNDEFINED_TYPE;
                *lp++ = mdb->mi_adxs[a->a_desc->ad_index];
                l = a->a_numvals;
                if (a->a_nvals != a->a_vals)