This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Fix off-by-one bug calling value_cstring
- From: Doug Evans <dje at google dot com>
- To: Daniel Colascione <dancol at dancol dot org>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Wed, 12 Nov 2014 07:47:33 -0800
- Subject: Re: Fix off-by-one bug calling value_cstring
- Authentication-results: sourceware.org; auth=none
- References: <5433792E dot 206 at dancol dot org> <CADPb22QgjrPZD8yqbXLHbPLMXfMbXFR-zOnTUeqc66FHV=o1_Q at mail dot gmail dot com> <545FE4CA dot 6080707 at dancol dot org>
On Sun, Nov 9, 2014 at 2:03 PM, Daniel Colascione <dancol@dancol.org> wrote:
> On 10/08/2014 02:13 AM, Doug Evans wrote:
>> I don't have an answer. If I get to this before someone else I'll
>> pick something, but it might be a few days.
>
> Did you get around to fixing the bug?
Hi.
I haven't had time to yet.
I looked at it a bit.
It seems most(all?) callers of value_cstring work like savestring and
pass a length that doesn't include the trailing NUL, so I'd say let's
stick with that. We still need to fix value_cstring though and add
one to the given length (I presume that's the intended semantics).