ldap/servers/plugins/retrocl/retrocl.c | 1 +
1 file changed, 1 insertion(+)
New commits:
commit 9f91c67cfc9de5378527cfdb497cd11d9df1a54b
Author: Endi S. Dewata <edewata(a)redhat.com>
Date: Tue Jan 19 15:49:52 2010 -0600
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
diff --git a/ldap/servers/plugins/retrocl/retrocl.c
b/ldap/servers/plugins/retrocl/retrocl.c
index c586e37..271e7fd 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);
Show replies by date