[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] [PATCH 30/57] Call snprintf() from signal handler only
From: |
Tommi Rantala |
Subject: |
[Libunwind-devel] [PATCH 30/57] Call snprintf() from signal handler only if required in test-async-sig |
Date: |
Fri, 21 Sep 2012 14:11:31 +0300 |
snprintf() is not guaranteed to be safely callable from a signal
handler, so avoid calling it in the default non-verbose case.
---
tests/test-async-sig.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/test-async-sig.c b/tests/test-async-sig.c
index ba37c90..9a0d39e 100644
--- a/tests/test-async-sig.c
+++ b/tests/test-async-sig.c
@@ -89,7 +89,8 @@ do_backtrace (int may_print, int get_proc_name)
buf[0] = '\0';
if (get_proc_name || (may_print && verbose))
{
- if (unw_get_proc_name (&cursor, name, sizeof (name), &off) == 0)
+ ret = unw_get_proc_name (&cursor, name, sizeof (name), &off);
+ if (ret == 0 && (may_print && verbose))
{
if (off)
snprintf (buf, sizeof (buf), "<%s+0x%lx>", name, (long) off);
--
1.7.9.5
- [Libunwind-devel] [PATCH 21/57] Annotate potentially unused variable in tests/Gtest-trace.c, (continued)
- [Libunwind-devel] [PATCH 21/57] Annotate potentially unused variable in tests/Gtest-trace.c, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 22/57] Annotate potentially unused variable in tests/test-coredump-unwind.c, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 24/57] Rename `test-varargs' to `Ltest-varargs', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 29/57] Roll `test-nocalloc' into `Ltest-nocalloc.c', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 27/57] Rename `rs-race' to `Lrs-race', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 28/57] Call `unw_backtrace()' explicitly in test-flush-cache.c, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 25/57] Remove unneeded `config.h' inclusion in Gtest-nomalloc, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 23/57] Drop `optimize' attribute in tests/test-varargs.c, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 30/57] Call snprintf() from signal handler only if required in test-async-sig,
Tommi Rantala <=
- [Libunwind-devel] [PATCH 32/57] Stop including `memory.h', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 31/57] Nuke HAVE_BACKTRACE, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 34/57] Enable coredump library build on ARM by default, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 33/57] MIPS coredump support, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 36/57] ppc32: include `compiler.h' for UNUSED in ucontext_i.h, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 40/57] Constify `dwarf_to_unw_regnum_map', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 37/57] ppc32: `UNW_PPC32_REGS' fixlet, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 38/57] IA64: give prototype for `ia64_find_unwind_table()', Tommi Rantala, 2012/09/21