summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2010-01-19 15:49:52 -0600
committerRich Megginson <rmeggins@redhat.com>2010-01-20 10:22:11 -0700
commit9f91c67cfc9de5378527cfdb497cd11d9df1a54b (patch)
tree7ca01bca88d46252b91889fb3defe741f1cd464a
parentf6d937e8189a5ebc2d096731bf811f3b370db612 (diff)
downloadds-9f91c67cfc9de5378527cfdb497cd11d9df1a54b.tar.gz
ds-9f91c67cfc9de5378527cfdb497cd11d9df1a54b.tar.xz
ds-9f91c67cfc9de5378527cfdb497cd11d9df1a54b.zip
Bug 557185 - Unterminated string after strncpy in Retro Changelog Plugin
According to the strncpy() manual, if there is no null byte among the first n bytes of src, the string placed in dest will not be null terminated. To fix the problem the null byte should be added manually. Reviewed by: rmeggins Pushed by: rmeggins
-rw-r--r--ldap/servers/plugins/retrocl/retrocl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ldap/servers/plugins/retrocl/retrocl.c b/ldap/servers/plugins/retrocl/retrocl.c
index c586e378..271e7fd1 100644
--- a/ldap/servers/plugins/retrocl/retrocl.c
+++ b/ldap/servers/plugins/retrocl/retrocl.c
@@ -358,6 +358,7 @@ static int retrocl_start (Slapi_PBlock *pb)
} else {
retrocl_attributes[i] = slapi_ch_malloc(pos-value+1);
strncpy(retrocl_attributes[i], value, pos-value);
+ retrocl_attributes[i][pos-value] = NULL;
retrocl_aliases[i] = slapi_ch_malloc(value+length-pos);
strcpy(retrocl_aliases[i], pos+1);