]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#303: value_add_fast() empty value bug. Ignore empty value.
authorKurt Zeilenga <kurt@openldap.org>
Fri, 24 Sep 1999 04:19:37 +0000 (04:19 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 24 Sep 1999 04:19:37 +0000 (04:19 +0000)
This is technical incorrect, but we don't have the codes in place
to correctly handle empty values yet.

servers/slapd/value.c

index 58f1711d1c1993b481d468c7fb749bf02d545fb1..2a0ea1600968e3ec3a9cb1f1b0652975f402f2d3 100644 (file)
@@ -39,10 +39,10 @@ value_add_fast(
                    *maxvals * sizeof(struct berval *) );
        }
 
-       for ( i = 0, j = 0; i < naddvals; i++, j++ ) {
+       for ( i = 0, j = 0; i < naddvals; i++ ) {
                if ( addvals[i]->bv_len > 0 ) {
                        (*vals)[nvals + j] = ber_bvdup( addvals[i] );
-                       if( (*vals)[nvals + j] == NULL ) break;
+                       if( (*vals)[nvals + j] != NULL ) j++;
                }
        }
        (*vals)[nvals + j] = NULL;