elfutils/elfutils-0.176-gcc-pr88835.patch
Mark Wielaard dfe2b39ed2 0.176-1 - New upstream release.
- backends: riscv improved core file and return value location support.
- Fixes CVE-2019-7146, CVE-2019-7148, CVE-2019-7149, CVE-2019-7150,
        CVE-2019-7664, CVE-2019-7665.
2019-02-15 17:30:04 +01:00

29 lines
1.0 KiB
Diff

Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88835
diff --git a/src/readelf.c b/src/readelf.c
index 33706bd..b55844c 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -10143,7 +10143,7 @@ print_debug_str_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
++digits;
tmp >>= 4;
}
- digits = MAX (4, digits);
+ digits = MIN (16, MAX (4, digits));
printf (gettext ("\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"
" %*s String\n"),
diff --git a/tests/backtrace.c b/tests/backtrace.c
index 05e8ef8..d621fbf 100644
--- a/tests/backtrace.c
+++ b/tests/backtrace.c
@@ -185,7 +185,7 @@ frame_callback (Dwfl_Frame *state, void *frame_arg)
symname = dwfl_module_addrname (mod, pc_adjusted);
printf ("#%2d %#" PRIx64 "%4s\t%s\n", *framenop, (uint64_t) pc,
- ! isactivation ? "- 1" : "", symname);
+ ! isactivation ? "- 1" : "", symname ?: "<null>");
pid_t tid = dwfl_thread_tid (thread);
callback_verify (tid, *framenop, pc, symname, dwfl);
(*framenop)++;