debugedit: edit_dwarf2 check lndx is in range before checking r_offset.

This commit is contained in:
Mark Wielaard 2017-10-13 23:27:32 +02:00 committed by Panu Matilainen
parent b4ecfcfff1
commit 846b83212c

View File

@ -2141,10 +2141,10 @@ edit_dwarf2 (DSO *dso)
r_offset = rel.r_offset;
}
while (r_offset > (dso->lines.table[lndx].old_idx
+ 4
+ dso->lines.table[lndx].unit_length)
&& lndx < dso->lines.used)
while (lndx < dso->lines.used
&& r_offset > (dso->lines.table[lndx].old_idx
+ 4
+ dso->lines.table[lndx].unit_length))
lndx++;
if (lndx >= dso->lines.used)