From 63e040391d8ae958a2fe04f2b836fecfdb782431 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 30 Jan 2021 16:19:08 -0500 Subject: [PATCH] lib: Prevent unininted usage of data Valgrind reports that some data being used in the stack unwind of a crash is being used uninitailized. Signed-off-by: Donald Sharp --- lib/log.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/log.c b/lib/log.c index 03ed23a04b..f7275589c2 100644 --- a/lib/log.c +++ b/lib/log.c @@ -179,6 +179,9 @@ void zlog_backtrace_sigsafe(int priority, void *program_counter) unw_word_t ip, off, sp; Dl_info dlinfo; + memset(&uc, 0, sizeof(uc)); + memset(&cursor, 0, sizeof(cursor)); + unw_getcontext(&uc); unw_init_local(&cursor, &uc); while (unw_step(&cursor) > 0) { -- 2.39.5