From 62ee19c76317a91718b2ffa193f3849942955629 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 4 May 2010 16:07:18 -0600 Subject: [PATCH] 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. --- src/util/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);