From: Mikael Magnusson Date: Fri, 15 Dec 2023 22:19:47 +0000 (+0100) Subject: netifd: fix undefined va_list value which can cause crashes X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=730b4656e6b1349506316dab2a8d90399eab39d8;p=project%2Fnetifd.git netifd: fix undefined va_list value which can cause crashes Reinitialize the va_list value after the call to netifd_udebug_vprintf() in netifd_log_message(). It's needed since netifd_udebug_vprintf() invokes vsnprintf() which in turn invokes the va_arg() macro, and after that call the va_list value is undefined. Signed-off-by: Mikael Magnusson --- diff --git a/main.c b/main.c index b6d2aa5..375c6ab 100644 --- a/main.c +++ b/main.c @@ -126,6 +126,9 @@ netifd_log_message(int priority, const char *format, ...) va_start(vl, format); netifd_udebug_vprintf(format, vl); + va_end(vl); + + va_start(vl, format); if (use_syslog) vsyslog(log_class[priority], format, vl); else