From 730b4656e6b1349506316dab2a8d90399eab39d8 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Fri, 15 Dec 2023 23:19:47 +0100 Subject: [PATCH] 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 --- main.c | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.30.2