Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches <gdb-patches@sourceware.org>,
	   Joel Brobecker <brobecker@adacore.com>,
	   Sterling Augustine <saugustine@google.com>
Subject: Re: [PATCH] PR 16286: Reading python value as string beyond declared size
Date: Wed, 11 Dec 2013 00:25:00 -0000	[thread overview]
Message-ID: <21159.45272.300672.237174@ruffy.mtv.corp.google.com> (raw)
In-Reply-To: <529F1654.8000704@redhat.com>

Pedro Alves writes:
 > On 12/03/2013 11:01 PM, Doug Evans wrote:
 > > On Tue, Dec 3, 2013 at 12:29 PM, Pedro Alves <palves@redhat.com> wrote:
 > >> On 12/02/2013 11:14 PM, Doug Evans wrote:
 > >>> +      if (*length > 0)
 > >>> +     fetchlimit = UINT_MAX;
 > >>
 > >> Shouldn't this be:
 > >>
 > >>       if (*length > 0)
 > >>         fetchlimit = *length;
 > >>
 > >> ?  That is, if the caller specified a limit, why do we do over it?
 > > 
 > > read_string will take min (len, fetchlimit), and I saw no value in
 > > passing fetchlimit = *length.
 > 
 > Ah, I see now.  Thanks.

Thanks.  Committed.

 > >> BTW, it looks like the not_lval/lval_internalvar path can
 > >> blindly read beyond the value's contents buffer, if *length
 > >> is bigger than the value's contents buffer size:
 > > It didn't look right to me either, but I was leaving digging deeper
 > > for another pass.
 > 
 > OK.  TBC, I wasn't requesting that'd be fixed in this patch, only
 > for confirmation that I wasn't missing something.

I filed https://sourceware.org/bugzilla/show_bug.cgi?id=16313


      reply	other threads:[~2013-12-11  0:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-02 23:15 Doug Evans
2013-12-03 20:29 ` Pedro Alves
2013-12-03 23:01   ` Doug Evans
2013-12-04 11:47     ` Pedro Alves
2013-12-11  0:25       ` Doug Evans [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=21159.45272.300672.237174@ruffy.mtv.corp.google.com \
    --to=dje@google.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=saugustine@google.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