From: Alan Modra Date: Tue, 26 Sep 2017 00:02:18 +0000 (+0930) Subject: PR22204, Lack of DW_LNE_end_sequence causes "infinite" loop X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=e338894dc2e603683bed2172e8e9f25b29051005;p=deliverable%2Fbinutils-gdb.git PR22204, Lack of DW_LNE_end_sequence causes "infinite" loop PR 22204 * dwarf2.c (decode_line_info): Ensure line_ptr stays within bounds in inner loop. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 54199ad042..5c4cc2bccd 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2017-09-26 Alan Modra + + PR 22204 + * dwarf2.c (decode_line_info): Ensure line_ptr stays within + bounds in inner loop. + 2017-09-25 Alan Modra PR 22202 diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 9ae5fba637..2c45790935 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -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;