PR22204, Lack of DW_LNE_end_sequence causes "infinite" loop
authorAlan Modra <amodra@gmail.com>
Tue, 26 Sep 2017 00:02:18 +0000 (09:32 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 26 Sep 2017 00:06:50 +0000 (09:36 +0930)
PR 22204
* dwarf2.c (decode_line_info): Ensure line_ptr stays within
bounds in inner loop.

bfd/ChangeLog
bfd/dwarf2.c

index 54199ad042954de9a3c6e86becb281046b182ba3..5c4cc2bccd10ee609a660c45e2ff24df6762f78f 100644 (file)
@@ -1,3 +1,9 @@
+2017-09-26  Alan Modra  <amodra@gmail.com>
+
+       PR 22204
+       * dwarf2.c (decode_line_info): Ensure line_ptr stays within
+       bounds in inner loop.
+
 2017-09-25  Alan Modra  <amodra@gmail.com>
 
        PR 22202
index 9ae5fba63790c59f9e2aab5f2313d412822fdde9..2c457909356b4a4d2f44ca117cbca7d3e5c42980 100644 (file)
@@ -2277,7 +2277,7 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
       bfd_vma high_pc = 0;
 
       /* Decode the table.  */
-      while (! end_sequence)
+      while (!end_sequence && line_ptr < line_end)
        {
          op_code = read_1_byte (abfd, line_ptr, line_end);
          line_ptr += 1;