public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* asan: segv in parse_module
@ 2023-01-04 13:25 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-01-04 13:25 UTC (permalink / raw)
  To: binutils

	* 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-04 13:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-04 13:25 asan: segv in parse_module 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).