]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests/backtrace.c (frame_callback): Error on seeing more than 16 frames.
authorMark Wielaard <mjw@redhat.com>
Sun, 15 Jun 2014 09:35:50 +0000 (11:35 +0200)
committerMark Wielaard <mjw@redhat.com>
Tue, 17 Jun 2014 14:55:28 +0000 (16:55 +0200)
Don't fill up the test logs with obviously bogus frames.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
tests/ChangeLog
tests/backtrace.c

index 90a2a0eecd8f667a3bd9e01d2d86bb309939cd5e..dce6ebe6748ff450277e0c51330188f1623df4ae 100644 (file)
@@ -1,3 +1,7 @@
+2014-06-15  Mark Wielaard  <mjw@redhat.com>
+
+       * backtrace.c (frame_callback): Error on seeing more than 16 frames.
+
 2014-06-13  Mark Wielaard  <mjw@redhat.com>
 
        * backtrace.c (callback_verify): Accept "__libc_do_syscall" as first
index 1d3948ebf3773d344a82ec9859ad24aa7a4e6cf1..331ba0f2bed55c27e90b6f039723694266165c57 100644 (file)
@@ -148,6 +148,13 @@ frame_callback (Dwfl_Frame *state, void *frame_arg)
   int *framenop = frame_arg;
   Dwarf_Addr pc;
   bool isactivation;
+
+  if (*framenop > 16)
+    {
+      error (0, 0, "Too many frames: %d\n", *framenop);
+      return DWARF_CB_ABORT;
+    }
+
   if (! dwfl_frame_pc (state, &pc, &isactivation))
     {
       error (0, 0, "%s", dwfl_errmsg (-1));