This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Use rs->buf after getpkt
- From: Yao Qi <yao at codesourcery dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Wed, 5 Feb 2014 20:26:57 +0800
- Subject: Re: [PATCH] Use rs->buf after getpkt
- Authentication-results: sourceware.org; auth=none
- References: <1390652193-6018-1-git-send-email-yao at codesourcery dot com> <52F13EBE dot 9040307 at redhat dot 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 (éå)