bus: Properly va_copy() argument list before passing it to printf() functions

As we later potentially use args again, we can't consume it with printf
functions without copying it first. Clone list before passing it to any
consuming function.

Fixes #621.
This commit is contained in:
Martin Willi 2014-06-19 10:10:54 +02:00
parent 758dc8a953
commit 8b855a97c2

View File

@ -391,7 +391,9 @@ METHOD(bus_t, vlog, void,
{
len++;
data.message = malloc(len);
len = vsnprintf(data.message, len, format, args);
va_copy(data.args, args);
len = vsnprintf(data.message, len, format, data.args);
va_end(data.args);
}
if (len > 0)
{