From: Alan Modra <amodra@sourceware.org>
To: binutils-cvs@sourceware.org
Subject: [binutils-gdb] PR31873, buffer overflow in evax_bfd_print_dst
Date: Mon, 10 Jun 2024 13:31:27 +0000 (GMT) [thread overview]
Message-ID: <20240610133127.726203858403@sourceware.org> (raw)
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);
reply other threads:[~2024-06-10 13:31 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=20240610133127.726203858403@sourceware.org \
--to=amodra@sourceware.org \
--cc=binutils-cvs@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).