* XCOFF sanity check
@ 2023-03-27 11:24 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-03-27 11:24 UTC (permalink / raw)
To: binutils
* coffcode.h (coff_pointerize_aux_hook): Sanity check
x_csect.x_scnlen against raw_syment_count.
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 7a4c409a756..bf55d83530d 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;
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-27 11:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-27 11:24 XCOFF sanity check Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).