memset (ui, 0, sizeof (struct pex64_unwind_info));
- if (ex_dta >= ex_dta_end || ex_dta + 4 >= ex_dta_end)
+ if (ex_dta >= ex_dta_end || ex_dta + 4 > ex_dta_end)
return false;
ui->Version = PEX64_UWI_VERSION (ex_ui->Version_Flags);
ui->rawUnwindCodesEnd = ex_dta_end;
ex_dta += ui->SizeOfBlock;
- if (ex_dta >= ex_dta_end)
+ if (ex_dta > ex_dta_end)
return false;
switch (ui->Flags)
{
case UNW_FLAG_CHAININFO:
- if (ex_dta + 12 >= ex_dta_end)
+ if (ex_dta + 12 > ex_dta_end)
return false;
ui->rva_BeginAddress = bfd_get_32 (abfd, ex_dta + 0);
ui->rva_EndAddress = bfd_get_32 (abfd, ex_dta + 4);
case UNW_FLAG_EHANDLER:
case UNW_FLAG_UHANDLER:
case UNW_FLAG_FHANDLER:
- if (ex_dta + 4 >= ex_dta_end)
+ if (ex_dta + 4 > ex_dta_end)
return false;
ui->rva_ExceptionHandler = bfd_get_32 (abfd, ex_dta);
ui->SizeOfBlock += 4;
i = 0;
- if (ui->rawUnwindCodes + 1 >= ui->rawUnwindCodesEnd)
+ if (ui->rawUnwindCodes + ui->CountOfCodes * 2 > ui->rawUnwindCodesEnd)
{
fprintf (file, _("warning: corrupt unwind data\n"));
return;
to decode instruction flow if outside an epilog. */
unsigned int func_size = rf->rva_EndAddress - rf->rva_BeginAddress;
- if (ui->rawUnwindCodes + 1 + (ui->CountOfCodes * 2) >= ui->rawUnwindCodesEnd)
- {
- fprintf (file, _("warning: corrupt unwind data\n"));
- return;
- }
-
fprintf (file, "\tv2 epilog (length: %02x) at pc+:",
ui->rawUnwindCodes[0]);
fputc ('\n', file);
}
- if (ui->rawUnwindCodes + 2 + (ui->CountOfCodes * 2) >= ui->rawUnwindCodesEnd)
- {
- fprintf (file, _("warning: corrupt unwind data\n"));
- return;
- }
-
for (; i < ui->CountOfCodes; i++)
{
const bfd_byte *dta = ui->rawUnwindCodes + 2 * i;