From: Pierangelo Masarati Date: Sat, 15 Sep 2007 17:30:07 +0000 (+0000) Subject: further fix ITS#5138 (please review) X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~632 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d1c4d6481f3a6a9d753a4d713f705b67d696462b;p=openldap further fix ITS#5138 (please review) --- diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index 047bee5d39..a1c97a2094 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -610,16 +610,17 @@ ldap_build_entry( * change, should we massage them as well? */ if ( dnPrettyNormal( NULL, bdn, &ent->e_name, &ent->e_nname, - op->o_tmpmemctx ) != LDAP_SUCCESS ) { + op->o_tmpmemctx ) != LDAP_SUCCESS ) + { return LDAP_INVALID_DN_SYNTAX; } - attrp = &ent->e_attrs; - + ent->e_attrs = NULL; if ( ber_first_element( &ber, &len, &lastb ) != LBER_SEQUENCE ) { - return LDAP_DECODING_ERROR; + return LDAP_SUCCESS; } + attrp = &ent->e_attrs; while ( ber_next_element( &ber, &len, lastb ) == LBER_SEQUENCE && ber_scanf( &ber, "{m", &a ) != LBER_ERROR ) { int i;