summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/referral.c
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2005-03-05 04:29:24 +0000
committerRich Megginson <rmeggins@redhat.com>2005-03-05 04:29:24 +0000
commitb352660e243c7b9b7d050f1c38cff1c9faf278b1 (patch)
treeede08019beb931c3206609ab2377a015d510bdb4 /ldap/servers/slapd/referral.c
parentf08951680ddfebc3f3df07e720ad0650fe473c0f (diff)
downloadds-b352660e243c7b9b7d050f1c38cff1c9faf278b1.tar.gz
ds-b352660e243c7b9b7d050f1c38cff1c9faf278b1.tar.xz
ds-b352660e243c7b9b7d050f1c38cff1c9faf278b1.zip
clean up sprintf usage and many other flawfinder issues; clean up compiler warnings on Linux; remove pam_passthru from DS 7.1
Diffstat (limited to 'ldap/servers/slapd/referral.c')
-rw-r--r--ldap/servers/slapd/referral.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/ldap/servers/slapd/referral.c b/ldap/servers/slapd/referral.c
index 4391c6b9..cede05d6 100644
--- a/ldap/servers/slapd/referral.c
+++ b/ldap/servers/slapd/referral.c
@@ -1089,13 +1089,11 @@ get_data_source(Slapi_PBlock *pb, const Slapi_DN *sdn, int orc, void *cfrp)
/* Get the basic referral */
bv = slapi_ch_bvdup(the_refs->ra_refs[walker]->ref_referral);
old_referral_string = bv->bv_val;
- /* The longest new string will be one character longer than the old one */
- new_referral_string = slapi_ch_malloc(bv->bv_len + 1);
/* Re-write it to replace ldap with ldaps, and remove the port information */
/* The original string will look like this: ldap://host:port */
/* We need to make it look like this: ldaps://host */
/* Potentially the ":port" part might be missing from the original */
- sprintf(new_referral_string, "%s%s" , LDAPS_URL_PREFIX, old_referral_string + strlen(LDAP_URL_PREFIX) );
+ new_referral_string = slapi_ch_smprintf("%s%s" , LDAPS_URL_PREFIX, old_referral_string + strlen(LDAP_URL_PREFIX) );
/* Go looking for the port */
p = new_referral_string + (strlen(LDAPS_URL_PREFIX) + 1);
while (*p != '\0' && *p != ':') p++;