aboutsummaryrefslogtreecommitdiff
path: root/bfd/dwarf2.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-09-26 09:32:18 +0930
committerAlan Modra <amodra@gmail.com>2017-09-26 09:36:50 +0930
commite338894dc2e603683bed2172e8e9f25b29051005 (patch)
tree8f7df0c8c70dcd57c91a7622cad195fc7a4af26e /bfd/dwarf2.c
parent898f57a89f3f75d542892c891e0736a8d91f42d3 (diff)
downloadgdb-e338894dc2e603683bed2172e8e9f25b29051005.zip
gdb-e338894dc2e603683bed2172e8e9f25b29051005.tar.gz
gdb-e338894dc2e603683bed2172e8e9f25b29051005.tar.bz2
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.
Diffstat (limited to 'bfd/dwarf2.c')
-rw-r--r--bfd/dwarf2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 9ae5fba..2c45790 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;