提交 f89a7bbe 编写于 作者: P Pieter Noordhuis 提交者: antirez

va_copy must be matched by va_end

Hat tip to @rfuchs. See: https://github.com/redis/hiredis/pull/178.

Fixes #1187
上级 dbcf3810
......@@ -388,6 +388,7 @@ sds sdscatvprintf(sds s, const char *fmt, va_list ap) {
buf[buflen-2] = '\0';
va_copy(cpy,ap);
vsnprintf(buf, buflen, fmt, cpy);
va_end(ap);
if (buf[buflen-2] != '\0') {
if (buf != staticbuf) zfree(buf);
buflen *= 2;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册