From: Eric Blake Date: Tue, 4 May 2010 22:07:18 +0000 (-0600) Subject: util: fix va_start usage bug X-Git-Tag: v0.8.2~329 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62ee19c76317a91718b2ffa193f3849942955629;p=thirdparty%2Flibvirt.git 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. --- diff --git a/src/util/util.c b/src/util/util.c index 2d329527dc..c44d0126e0 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -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);