From: Ondřej Kuzník Date: Tue, 11 Aug 2015 12:27:22 +0000 (+0200) Subject: ITS#8215 Do not crash on an empty entry X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5a6a93035d4d6866d4b251b079d958f0f23b6b5d;p=openldap ITS#8215 Do not crash on an empty entry --- diff --git a/servers/slapd/slapmodify.c b/servers/slapd/slapmodify.c index 63166c377e..96c1c09f97 100644 --- a/servers/slapd/slapmodify.c +++ b/servers/slapd/slapmodify.c @@ -480,8 +480,6 @@ slapmodify( int argc, char **argv ) a = attr_find( e->e_attrs, slap_schema.si_ad_entryUUID ); if ( a != NULL ) { - vals[0].bv_len = lutil_uuidstr( uuidbuf, sizeof( uuidbuf ) ); - vals[0].bv_val = uuidbuf; if ( a->a_vals != a->a_nvals ) { SLAP_FREE( a->a_nvals[0].bv_val ); SLAP_FREE( a->a_nvals ); @@ -492,6 +490,8 @@ slapmodify( int argc, char **argv ) a->a_nvals = NULL; a->a_numvals = 0; } + vals[0].bv_len = lutil_uuidstr( uuidbuf, sizeof( uuidbuf ) ); + vals[0].bv_val = uuidbuf; attr_merge_normalize_one( e, slap_schema.si_ad_entryUUID, vals, NULL ); a = attr_find( e->e_attrs, slap_schema.si_ad_creatorsName );