From: Pierangelo Masarati Date: Fri, 14 Sep 2007 23:59:53 +0000 (+0000) Subject: import fix to ITS#5136 X-Git-Tag: OPENLDAP_REL_ENG_2_3_39~30 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2eba34a7854beac224a17e81d2e2617ae596ee91;p=openldap import fix to ITS#5136 --- diff --git a/CHANGES b/CHANGES index 0a064b6579..9a068fda52 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,7 @@ OpenLDAP 2.3.39 Engineering Fixed slapd password_hash config order (ITS#5082) Fixed slapd slap_mods_check bug (ITS#5119) Fixed slapd ACL sets memory handling (ITS#4873) + Fixed slapd ordered values add normalization issue (ITS#5136) Fixed slapd-bdb DB_CONFIG conversion bug (ITS#5118) Fixed slapd-ldap SASL idassert w/o autchId Fixed slapd-sql concurrency issue (ITS#5095) diff --git a/servers/slapd/value.c b/servers/slapd/value.c index 9e3b5fde67..edeaff12e8 100644 --- a/servers/slapd/value.c +++ b/servers/slapd/value.c @@ -697,7 +697,21 @@ ordered_value_add( } new = ch_malloc( (anum+vnum+1) * sizeof(struct berval)); - if ( a->a_nvals && a->a_nvals != a->a_vals ) { + + /* sanity check: if normalized modifications come in, either + * no values are present or normalized existing values differ + * from non-normalized; if no normalized modifications come in, + * either no values are present or normalized existing values + * don't differ from non-normalized */ + if ( nvals != NULL ) { + assert( nvals != vals ); + assert( a->a_nvals == NULL || a->a_nvals != a->a_vals ); + + } else { + assert( a->a_nvals == NULL || a->a_nvals == a->a_vals ); + } + + if ( ( a->a_nvals && a->a_nvals != a->a_vals ) || nvals != NULL ) { nnew = ch_malloc( (anum+vnum+1) * sizeof(struct berval)); /* Shouldn't happen... */ if ( !nvals ) nvals = vals;