From: Howard Chu Date: Tue, 19 Mar 2013 20:32:42 +0000 (-0700) Subject: ITS#7540 reject undefined attrs X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=daf62a0841f2d6a4102bca706d936f7e846c2593;p=openldap ITS#7540 reject undefined attrs --- diff --git a/servers/slapd/back-mdb/id2entry.c b/servers/slapd/back-mdb/id2entry.c index 9e6f840e80..d3d238f353 100644 --- a/servers/slapd/back-mdb/id2entry.c +++ b/servers/slapd/back-mdb/id2entry.c @@ -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)