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.2.10~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48f423db400f6210b946699975277e9c383aca1f;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 efbc335486..2141369c62 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -174,8 +174,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;