提交 48f423db authored 作者: William King's avatar William King

This was writing a null one space to the right, outside of the malloc'd buffer.…

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.
上级 dec5a592
...@@ -174,8 +174,6 @@ SWITCH_DECLARE(char *) switch_find_parameter(const char *str, const char *param, ...@@ -174,8 +174,6 @@ SWITCH_DECLARE(char *) switch_find_parameter(const char *str, const char *param,
r = malloc(mlen); r = malloc(mlen);
} }
*(r + mlen) = '\0';
switch_snprintf(r, mlen, "%s", ptr); switch_snprintf(r, mlen, "%s", ptr);
break; break;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论