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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user