Fix a seg-fault in readelf when parsing corrupt HPPA unwind tables.
authorL. Simon <l.simon@samsung.com>
Tue, 21 Aug 2018 14:37:06 +0000 (15:37 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 21 Aug 2018 14:37:06 +0000 (15:37 +0100)
PR 23531
* readelf.c (hppa_process_unwind): Only dump the unwind table if
the data was successfully read in.

binutils/ChangeLog
binutils/readelf.c

index 265bd68fc5360898adc831db001f2e143f244669..ab7183b527de8baa48ec2243526b18b05ba256ab 100644 (file)
@@ -1,3 +1,9 @@
+2018-08-21  L. Simon  <l.simon@samsung.com>
+
+       PR 23531
+       * readelf.c (hppa_process_unwind): Only dump the unwind table if
+       the data was successfully read in.
+
 2018-08-18  Alan Modra  <amodra@gmail.com>
 
        * testsuite/lib/binutils-common.exp (is_elf64): Use directory of
index 8a61db64595eece2ce4bf204864beb219a5841e7..52aebd379137def6011cd2a56e4c4d96bbf5357f 100644 (file)
@@ -8130,8 +8130,8 @@ hppa_process_unwind (Filedata * filedata)
 
           if (! slurp_hppa_unwind_table (filedata, &aux, sec))
            res = FALSE;
-       
-         if (aux.table_len > 0)
+
+         if (res && aux.table_len > 0)
            {
              if (! dump_hppa_unwind (filedata, &aux))
                res = FALSE;