From: William King Date: Sat, 18 May 2013 20:38:24 +0000 (-0700) Subject: This was writing a null one space to the right, outside of the malloc'd buffer. On... X-Git-Tag: v1.5.1~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f06bbd04a469d9709ed9bfed4959dc43751a55e;p=thirdparty%2Ffreeswitch.git This was writing a null one space to the right, outside of the malloc'd buffer. On further review this uses apr_vsnprintf which always returns null terminated. --- diff --git a/src/switch_utils.c b/src/switch_utils.c index d54fabaa06..7cec27e204 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -185,8 +185,6 @@ SWITCH_DECLARE(char *) switch_find_parameter(const char *str, const char *param, r = malloc(mlen); } - *(r + mlen) = '\0'; - switch_snprintf(r, mlen, "%s", ptr); break;