]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Prevent unininted usage of data 7985/head
authorDonald Sharp <sharpd@nvidia.com>
Sat, 30 Jan 2021 21:19:08 +0000 (16:19 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Sat, 30 Jan 2021 21:19:08 +0000 (16:19 -0500)
Valgrind reports that some data being used in the
stack unwind of a crash is being used uninitailized.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
lib/log.c

index 03ed23a04bcecf2bf221d450d6e604260a995f7b..f7275589c2cfedea166a8b111243825e777c95fd 100644 (file)
--- 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) {