Fix an illegal memory access when parsing a corrupt VMS Alpha file.

PR 29848
	* vms-alpha.c (parse_module): Fix potential out of bounds memory
	access.
This commit is contained in:
Nick Clifton
2022-12-05 11:11:44 +00:00
parent ecfbeec8d0
commit 942fa4fb32
2 changed files with 7 additions and 1 deletions

View File

@ -4366,7 +4366,7 @@ parse_module (bfd *abfd, struct module *module, unsigned char *ptr,
return false;
module->line_table = curr_line;
while (length == -1 || ptr < maxptr)
while (length == -1 || (ptr + 3) < maxptr)
{
/* The first byte is not counted in the recorded length. */
int rec_length = bfd_getl16 (ptr) + 1;