summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2010-05-18 16:11:32 -0700
committerNoriko Hosoi <nhosoi@redhat.com>2010-05-18 16:11:32 -0700
commitf999c42c3c4a2c39143fa9bfeddc55d03b25f8dc (patch)
tree06223774d73b60930f0259c7691ed3d99090d433
parentc12c48f47a0cdd7282950fa25e5e7548dd1c5ab0 (diff)
downloadds-f999c42c3c4a2c39143fa9bfeddc55d03b25f8dc.tar.gz
ds-f999c42c3c4a2c39143fa9bfeddc55d03b25f8dc.tar.xz
ds-f999c42c3c4a2c39143fa9bfeddc55d03b25f8dc.zip
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".
-rw-r--r--ldap/servers/slapd/util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ldap/servers/slapd/util.c b/ldap/servers/slapd/util.c
index 8987e634..fccee11c 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;
}