I believe the way things were setup on x86 meant this never triggered
(since n_regs == n_regs_mapping, the for loop would stop at the
correct moment), but the logic here looks clearly incorrect for the
general case. Fix.
* libebl/eblinitreg_sample.c (ebl_set_initial_registers_sample):
Be sure to break when i == n_regs_mapping, which is out of range.
Signed-off-by: Serhei Makarov <serhei@serhei.io>
dwarf_regs[i] = 0x0;
for (i = 0; i < n_regs; i++)
{
- if (i > n_regs_mapping)
+ if (i >= n_regs_mapping)
break;
if (regs_mapping[i] < 0 || regs_mapping[i] >= (int)ebl->frame_nregs)
continue;