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.
This commit is contained in:
Alan Modra
2017-09-26 09:32:18 +09:30
parent 898f57a89f
commit e338894dc2
2 changed files with 7 additions and 1 deletions

View 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

View 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;