Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Pedro Alves <palves@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Use rs->buf after getpkt
Date: Wed, 05 Feb 2014 12:29:00 -0000	[thread overview]
Message-ID: <52F22E11.1030200@codesourcery.com> (raw)
In-Reply-To: <52F13EBE.9040307@redhat.com>

On 02/05/2014 03:25 AM, Pedro Alves wrote:
> On 01/25/2014 12:16 PM, Yao Qi wrote:
>> Hi,
>> The following code snippet looks wrong to me
>>
>>  char *buf = rs->buf;
>>
>>  getpkt (&rs->buf, &rs->buf_size, 0);
>>  packet_ok (buf, );
>>
>> if rs->buf is reallocated in getpkt, buf points to an out of dated
>> memory. 
> 
> Indeed.
> 
>> This patch removes local 'buf' and uses rs->buf.
>>
>> Regression tested on x86_64-linux.  Is it OK?
> 
> OK.
> 

Thanks for the review.  Patch is pushed.

-- 
Yao (齐尧)


      reply	other threads:[~2014-02-05 12:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-25 12:18 Yao Qi
2014-02-04 19:25 ` Pedro Alves
2014-02-05 12:29   ` Yao Qi [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=52F22E11.1030200@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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