]> git.sur5r.net Git - openldap/commitdiff
ITS#8215 Do not crash on an empty entry
authorOndřej Kuzník <ondra@mistotebe.net>
Tue, 11 Aug 2015 12:27:22 +0000 (14:27 +0200)
committerHoward Chu <hyc@openldap.org>
Sun, 25 Oct 2015 09:02:06 +0000 (09:02 +0000)
servers/slapd/slapmodify.c

index 63166c377e869b7341586f8bfa76d3c719262cea..96c1c09f977185d1dd3c2d5439896b2fd6813374 100644 (file)
@@ -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 );