From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12684 invoked by alias); 5 Feb 2014 12:29:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 12674 invoked by uid 89); 5 Feb 2014 12:29:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=1.6 required=5.0 tests=AWL,BAYES_00,GARBLED_BODY autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Feb 2014 12:29:12 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WB1bI-0000Wo-3H from Yao_Qi@mentor.com ; Wed, 05 Feb 2014 04:29:08 -0800 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 5 Feb 2014 04:29:07 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Wed, 5 Feb 2014 04:29:06 -0800 Message-ID: <52F22E11.1030200@codesourcery.com> Date: Wed, 05 Feb 2014 12:29:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Pedro Alves CC: Subject: Re: [PATCH] Use rs->buf after getpkt References: <1390652193-6018-1-git-send-email-yao@codesourcery.com> <52F13EBE.9040307@redhat.com> In-Reply-To: <52F13EBE.9040307@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00035.txt.bz2 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 (齐尧)