From daf62a0841f2d6a4102bca706d936f7e846c2593 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 19 Mar 2013 13:32:42 -0700 Subject: [PATCH] ITS#7540 reject undefined attrs --- servers/slapd/back-mdb/id2entry.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.39.5