[PATCH] [libbacktrace] Initialize st in elf_is_symlink

james.hilliard1@gmail.com james.hilliard1@gmail.com
Mon Mar 18 02:54:00 GMT 2019


From: James Hilliard <james.hilliard1@gmail.com>

Fixes error: ‘st.st_mode’ may be used uninitialized in this function
---
 libbacktrace/elf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libbacktrace/elf.c b/libbacktrace/elf.c
index f3988ec02a0..714bfec965d 100644
--- a/libbacktrace/elf.c
+++ b/libbacktrace/elf.c
@@ -765,7 +765,7 @@ elf_syminfo (struct backtrace_state *state, uintptr_t addr,
 static int
 elf_is_symlink (const char *filename)
 {
-  struct stat st;
+  struct stat st={0};
 
   if (lstat (filename, &st) < 0)
     return 0;
-- 
2.17.1



More information about the Gcc-patches mailing list