XCOFF sanity check

* coffcode.h (coff_pointerize_aux_hook): Sanity check
	x_csect.x_scnlen against raw_syment_count.
This commit is contained in:
Alan Modra
2023-03-25 09:43:40 +10:30
parent eb42b9d6f9
commit 58c4c6a0bf

View File

@@ -2462,7 +2462,8 @@ coff_pointerize_aux_hook (bfd *abfd ATTRIBUTE_UNUSED,
&& indaux + 1 == symbol->u.syment.n_numaux)
{
BFD_ASSERT (! aux->is_sym);
if (SMTYP_SMTYP (aux->u.auxent.x_csect.x_smtyp) == XTY_LD)
if (SMTYP_SMTYP (aux->u.auxent.x_csect.x_smtyp) == XTY_LD
&& (bfd_vma) aux->u.auxent.x_csect.x_scnlen.l < obj_raw_syment_count (abfd))
{
aux->u.auxent.x_csect.x_scnlen.p =
table_base + aux->u.auxent.x_csect.x_scnlen.l;