mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
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:
parent
b0a3f8b6c5
commit
62ee19c763
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user