]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Handle repeated requests for invalid abbreviation
authorPetr Machata <pmachata@redhat.com>
Wed, 16 Mar 2011 17:16:12 +0000 (18:16 +0100)
committerPetr Machata <pmachata@redhat.com>
Wed, 16 Mar 2011 17:16:12 +0000 (18:16 +0100)
libdw/dwarf_tag.c
tests/Makefile.am
tests/run-rerequest_tag.sh
tests/testfile57.bz2 [new file with mode: 0644]

index 6d9090c6c20dd70561f7ab2cc79b45f71bd0d737..fa8b384c161e6db638e91c019d14564e6301d158 100644 (file)
@@ -90,6 +90,11 @@ __libdw_findabbrev (struct Dwarf_CU *cu, unsigned int code)
          break;
       }
 
+  /* This is our second (or third, etc.) call to __libdw_findabbrev
+     and the code is invalid.  */
+  if (unlikely (abb == NULL))
+    abb = DWARF_END_ABBREV;
+
   return abb;
 }
 
index 32a15e28375357e62e8e2e5b7fad39e7f4779a98..70029f7ce08eb3b294d61a57782dd6bc40434b06 100644 (file)
@@ -157,7 +157,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
             testfile55-32.bz2 testfile55-32.debug.bz2 \
             testfile55-32.prelink.bz2 testfile55-64.bz2 \
             testfile55-64.debug.bz2 testfile55-64.prelink.bz2 \
-            testfile56.bz2
+            testfile56.bz2 testfile57.bz2
 
 installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
                              bindir=$(DESTDIR)$(bindir) \
index 1636fbfe1d1b816828cb81cec69149b03945fafb..c61a9fd6b8afb8eef40bd2918915e02c206046e2 100755 (executable)
@@ -25,8 +25,9 @@
 
 . $srcdir/test-subr.sh
 
-testfiles testfile56
+testfiles testfile56 testfile57
 
 testrun ./rerequest_tag testfile56
+testrun ./rerequest_tag testfile57
 
 exit 0
diff --git a/tests/testfile57.bz2 b/tests/testfile57.bz2
new file mode 100644 (file)
index 0000000..59dbde1
Binary files /dev/null and b/tests/testfile57.bz2 differ