]> git.sur5r.net Git - openldap/commitdiff
Fix logic error in slap_mods2entry()
authorLuke Howard <lukeh@openldap.org>
Sun, 31 Jul 2005 05:12:20 +0000 (05:12 +0000)
committerLuke Howard <lukeh@openldap.org>
Sun, 31 Jul 2005 05:12:20 +0000 (05:12 +0000)
servers/slapd/add.c

index 30af7693dda1ae7be0983c4cebd17cd6a9b513ce..392a6c68e2df48f899ac59a710b491a75283326e 100644 (file)
@@ -395,12 +395,15 @@ slap_mods2entry(
        const char **text,
        char *textbuf, size_t textlen )
 {
-       Attribute **tail = &(*e)->e_attrs;
+       Attribute **tail;
 
        if ( initial ) {
-               assert( *tail == NULL );
+               assert( (*e)->e_attrs == NULL );
        }
 
+       for ( tail = &(*e)->e_attrs; *tail != NULL; tail = &(*tail)->a_next )
+               ;
+
        *text = textbuf;
 
        for( ; mods != NULL; mods = mods->sml_next ) {