Fix potential address violation parsing a corrupt Alpha VMS file.
PR binutils/21638 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized record.
This commit is contained in:
parent
cb06d03ad9
commit
3de58d950c
@ -1,3 +1,9 @@
|
||||
2017-06-21 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR binutils/21638
|
||||
* vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
|
||||
record.
|
||||
|
||||
2017-06-21 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR binutils/21637
|
||||
|
@ -1143,6 +1143,14 @@ _bfd_vms_slurp_egsd (bfd *abfd)
|
||||
|
||||
vms_debug2 ((2, "EGSD\n"));
|
||||
|
||||
if (PRIV (recrd.rec_size) < 8)
|
||||
{
|
||||
_bfd_error_handler (_("Corrupt EGSD record: its size (%#x) is too small"),
|
||||
PRIV (recrd.rec_size));
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
PRIV (recrd.rec) += 8; /* Skip type, size, align pad. */
|
||||
PRIV (recrd.rec_size) -= 8;
|
||||
|
||||
@ -1354,6 +1362,8 @@ _bfd_vms_slurp_egsd (bfd *abfd)
|
||||
PRIV (recrd.rec) += gsd_size;
|
||||
}
|
||||
|
||||
/* FIXME: Should we complain if PRIV (recrd.rec_size) is not zero ? */
|
||||
|
||||
if (PRIV (gsd_sym_count) > 0)
|
||||
abfd->flags |= HAS_SYMS;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user