aboutsummaryrefslogtreecommitdiff
path: root/bfd/vms-alpha.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2022-12-05 11:11:44 +0000
committerNick Clifton <nickc@redhat.com>2022-12-05 11:11:44 +0000
commit942fa4fb32738ecbb447546d54f1e5f0312d2ed4 (patch)
treef3e1e8e4cb2ed4644df8fbe5032fdd99bac8d834 /bfd/vms-alpha.c
parentecfbeec8d0a7687a6464caa088b2283b30a25d7e (diff)
downloadbinutils-942fa4fb32738ecbb447546d54f1e5f0312d2ed4.zip
binutils-942fa4fb32738ecbb447546d54f1e5f0312d2ed4.tar.gz
binutils-942fa4fb32738ecbb447546d54f1e5f0312d2ed4.tar.bz2
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.
Diffstat (limited to 'bfd/vms-alpha.c')
-rw-r--r--bfd/vms-alpha.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c
index 9531953..c0eb5bc 100644
--- a/bfd/vms-alpha.c
+++ b/bfd/vms-alpha.c
@@ -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;