* [binutils-gdb] PR31873, buffer overflow in evax_bfd_print_dst
@ 2024-06-10 13:31 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2024-06-10 13:31 UTC (permalink / raw)
To: binutils-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=539c3962fa08cfe46f71555f6b6d47326f3d9cda
commit 539c3962fa08cfe46f71555f6b6d47326f3d9cda
Author: Alan Modra <amodra@gmail.com>
Date: Mon Jun 10 22:50:26 2024 +0930
PR31873, buffer overflow in evax_bfd_print_dst
PR 31873
* vms-alpha.c (evax_bfd_print_dst): Sanity check len against
dst_size.
Diff:
---
bfd/vms-alpha.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c
index 404638cf3d9..337523015dc 100644
--- a/bfd/vms-alpha.c
+++ b/bfd/vms-alpha.c
@@ -7511,6 +7511,8 @@ evax_bfd_print_dst (struct bfd *abfd, unsigned int dst_size, FILE *file)
/* xgettext:c-format */
fprintf (file, _(" type: %3u, len: %3u (at 0x%08x): "),
type, len, off);
+ if (len > dst_size)
+ len = dst_size;
if (len < sizeof (dsth))
{
fputc ('\n', file);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-06-10 13:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-10 13:31 [binutils-gdb] PR31873, buffer overflow in evax_bfd_print_dst 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).