]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: fix va_start usage bug
authorEric Blake <eblake@redhat.com>
Tue, 4 May 2010 22:07:18 +0000 (16:07 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 4 May 2010 22:07:18 +0000 (16:07 -0600)
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

index 2d329527dc2af28ca846705ad84dabff05852b92..c44d0126e01f1c5fc6d51344b0485d8dd5e2338b 100644 (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);