提交 62ee19c7 编写于 作者: E Eric Blake

util: fix va_start usage bug

Detected by clang.  POSIX requires that the second argument to
va_start be the name of the last variable; and in some implementations,
passing *path instead of path would dereference bogus memory instead
of pulling arguments off the stack.

* src/util/util.c (virBuildPathInternal): Use correct argument to
va_start.
上级 b0a3f8b6
......@@ -2799,7 +2799,7 @@ int virBuildPathInternal(char **path, ...)
va_list ap;
int ret = 0;
va_start(ap, *path);
va_start(ap, path);
path_component = va_arg(ap, char *);
virBufferAdd(&buf, path_component, -1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册