ldap/servers/slapd/util.c | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit 9b22aa343316a34151d3775f1e0d306d8cd067d5
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue May 18 16:11:32 2010 -0700
593453 - Creating password policy with ns-newpolicy.pl on Replicated
Server Causes Crash
Fix description: normalized_mods->mod_bvalues is an array of
(struct berval *). When slapi_dn_normalize_ext returns an
allocated memory (case rc > 0), a new struct berval should have
been allocated and the address of the normalized string (normed)
and its length (dnlen) should be set in the berval.
The struct berval allocation was missing in the previous fix
for "Update to New DN Format".
diff --git a/ldap/servers/slapd/util.c b/ldap/servers/slapd/util.c
index 8987e63..fccee11 100644
--- a/ldap/servers/slapd/util.c
+++ b/ldap/servers/slapd/util.c
@@ -430,6 +430,8 @@ normalize_mods2bvals(const LDAPMod **mods)
*(normed + dnlen) = '\0';
*normmbvp = ber_bvdup(*mbvp);
} else {
+ *normmbvp =
+ (struct berval *)slapi_ch_malloc(sizeof(struct berval));
(*normmbvp)->bv_val = normed;
(*normmbvp)->bv_len = dnlen;
}
@@ -465,6 +467,8 @@ normalize_mods2bvals(const LDAPMod **mods)
(*normmbvp)->bv_val = slapi_ch_strdup(normed);
(*normmbvp)->bv_len = dnlen;
} else {
+ *normmbvp =
+ (struct berval *)slapi_ch_malloc(sizeof(struct berval));
(*normmbvp)->bv_val = normed;
(*normmbvp)->bv_len = dnlen;
}