From: Simon Marchi <simon.marchi@efficios.com>
To: Tom Tromey <tom@tromey.com>,
Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdb: fix off-by-one error in quirk_rust_enum
Date: Tue, 19 May 2020 14:21:08 -0400 [thread overview]
Message-ID: <08c51bfe-fce7-75e9-53bd-86b8cc85117a@efficios.com> (raw)
In-Reply-To: <87lfln7pqh.fsf@tromey.com>
On 2020-05-19 2:18 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
>
> Simon> Found by inspection, so I don't have a test for it (I don't think it
> Simon> would be easy to have this bug cause a failure reliably).
>
> Simon> We allocate space for N fields into `new_fields`, then memcpy N fields
> Simon> at `new_fields + 1`. This overflows the allocated buffer by one field.
>
> Simon> Fix it by allocating `N + 1` fields.
>
> Simon> gdb/ChangeLog:
>
> Simon> * dwarf2/read.c (quirk_rust_enum): Allocate enough fields.
>
> Looks good. Thank you.
>
> Tom
>
Thanks, pushed.
Simon
prev parent reply other threads:[~2020-05-19 18:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-19 18:15 Simon Marchi
2020-05-19 18:18 ` Tom Tromey
2020-05-19 18:21 ` Simon Marchi [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=08c51bfe-fce7-75e9-53bd-86b8cc85117a@efficios.com \
--to=simon.marchi@efficios.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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