From 9f91c67cfc9de5378527cfdb497cd11d9df1a54b Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Tue, 19 Jan 2010 15:49:52 -0600 Subject: 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 --- ldap/servers/plugins/retrocl/retrocl.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ldap/servers') 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); -- cgit