From: Howard Chu Date: Thu, 2 Feb 2012 11:08:33 +0000 (-0800) Subject: ITS#7146 check for ad_index overflow X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9d3b1af2ff1594463c2b58bde180e2ba84181a8b;p=openldap ITS#7146 check for ad_index overflow Temporary fix... --- diff --git a/servers/slapd/back-mdb/id2entry.c b/servers/slapd/back-mdb/id2entry.c index 40f816d2ac..cdc2e051a2 100644 --- a/servers/slapd/back-mdb/id2entry.c +++ b/servers/slapd/back-mdb/id2entry.c @@ -569,6 +569,11 @@ 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 >= MDB_MAXADS) { + Debug( LDAP_DEBUG_ANY, "mdb_entry_encode: too many AttributeDescriptions used\n", + 0, 0, 0 ); + return LDAP_OTHER; + } *lp++ = mdb->mi_adxs[a->a_desc->ad_index]; l = a->a_numvals; if (a->a_nvals != a->a_vals)