From: Tom Tromey <tom@tromey.com>
To: Stephan Rohr <stephan.rohr@intel.com>
Cc: gdb-patches@sourceware.org, tom@tromey.com
Subject: Re: [PATCH v2 1/1] gdb: fix overflow caused by value_print_array_elements
Date: Wed, 21 Oct 2026 10:38:13 -0600 [thread overview]
Message-ID: <87jynbypoq.fsf@tromey.com> (raw)
In-Reply-To: <20261021113045.171468-2-stephan.rohr@intel.com> (Stephan Rohr's message of "Wed, 21 Oct 2026 11:30:45 +0000")
>>>>> "Stephan" == Stephan Rohr <stephan.rohr@intel.com> writes:
Stephan> When printing an array whose stride is larger than its element type,
Stephan> GDB allocates memory for each array element based on the element's
Stephan> true type. The allocated buffer may include some padding.
Stephan> "value_print_array_elements ()" passes the stride as the bit length to
Stephan> "from_component_bitsize ()". This is silently swallowed if the stride
Stephan> does not exceed the size of the allocated buffer but corrupts the heap
Stephan> if the write goes beyond. Pass the size of the element's true type
Stephan> instead.
Thank you.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
prev parent reply other threads:[~2026-10-21 16:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 11:30 [PATCH v2 0/1] " Stephan Rohr
2026-10-21 11:30 ` [PATCH v2 1/1] " Stephan Rohr
2026-10-21 16:38 ` Tom Tromey [this message]
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=87jynbypoq.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=stephan.rohr@intel.com \
/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