From 58c4c6a0bf29525a029d64a6446ac5d9e0c45a4a Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 25 Mar 2023 09:43:40 +1030 Subject: XCOFF sanity check * coffcode.h (coff_pointerize_aux_hook): Sanity check x_csect.x_scnlen against raw_syment_count. --- bfd/coffcode.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 7a4c409..bf55d83 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -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; -- cgit v1.1