From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Subject: asan: segv in parse_module
Date: Wed, 4 Jan 2023 23:55:39 +1030 [thread overview]
Message-ID: <Y7V+U0bOlfYE++6E@squeak.grove.modra.org> (raw)
* vms-alpha.c (parse_module): Ignore DST__K_SRC_SETFILE data
if out of range.
diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c
index a9f87962f5b..fd2cf50441f 100644
--- a/bfd/vms-alpha.c
+++ b/bfd/vms-alpha.c
@@ -4577,8 +4577,11 @@ parse_module (bfd *abfd, struct module *module, unsigned char *ptr,
case DST__K_SRC_SETFILE:
data = bfd_getl16 (src_ptr + DST_S_W_SRC_UNSWORD);
- curr_srec->sfile = data;
- curr_srec->srec = module->file_table[data].srec;
+ if ((unsigned int) data < module->file_table_count)
+ {
+ curr_srec->sfile = data;
+ curr_srec->srec = module->file_table[data].srec;
+ }
vms_debug2 ((4, "DST_S_C_SRC_SETFILE: %d\n", data));
break;
--
Alan Modra
Australia Development Lab, IBM
reply other threads:[~2023-01-04 13:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y7V+U0bOlfYE++6E@squeak.grove.modra.org \
--to=amodra@gmail.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).