Skip to content
Commit fcabe3a5 authored by Marcin Niestroj's avatar Marcin Niestroj Committed by Ioannis Glaropoulos
Browse files

logging: fix immediate logging with multiple backends



va_list was initialized once and passed to log_backend_put_sync_string()
for each logging backend. State of such va_list was changed in each
execution, resulting in different va_list state to be passed for
consecutive log_backend_put_sync_string() calls. This results in
undefined behavior and program crashes.

Use va_copy() to copy va_list state to temporary variable for each
logging backend and keep original va_list untouched. Pass such temporary
state to log_backend_put_sync_string() to make sure state for all
consecutive calls does not change.

Signed-off-by: default avatarMarcin Niestroj <m.niestroj@grinn-global.com>
parent 0ca346f0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment