summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2010-06-30 11:37:34 -0600
committerRich Megginson <rmeggins@redhat.com>2010-07-01 15:50:26 -0600
commit6098df0ea1aec1c25334b4229fe196ca02c0fc26 (patch)
tree01eb219e89f72aab9a4f004b7bbcb91d4aa191cc
parent858f45f80fa73367bc5cf18b3dd29e3129fbe70c (diff)
Bug 609590 - fix coverity Defect Type: Memory - corruptions issues
https://bugzilla.redhat.com/show_bug.cgi?id=609590 Resolves: bug 609590 Bug Description: fix coverity Defect Type: Memory - corruptions issues Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: The point of this code is to copy the conn authtype to the operation authtype, so just do that. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
-rw-r--r--ldap/servers/slapd/connection.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c
index cf88a590..57672afe 100644
--- a/ldap/servers/slapd/connection.c
+++ b/ldap/servers/slapd/connection.c
@@ -2597,13 +2597,8 @@ op_copy_identity(Connection *conn, Operation *op)
if (dnlen <= 0 && typelen <= 0) {
op->o_authtype = NULL;
} else {
- char* id = slapi_ch_malloc (typelen + 1);
- if (typelen <= 0)
- id[dnlen+1] = '\0';
- else
- memcpy (id, conn->c_authtype, typelen + 1);
slapi_sdn_set_dn_byval(&op->o_sdn,conn->c_dn);
- op->o_authtype = id;
+ op->o_authtype = slapi_ch_strdup(conn->c_authtype);
}
/* XXX We should also copy c_client_cert into *op here; it's
* part of the authorization identity. The operation's copy