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.
This commit is contained in:
Eric Blake 2010-05-04 16:07:18 -06:00
parent b0a3f8b6c5
commit 62ee19c763

View File

@ -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);