From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adqIT-0005iB-3D for qemu-devel@nongnu.org; Wed, 09 Mar 2016 21:25:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adqIP-0003NL-0O for qemu-devel@nongnu.org; Wed, 09 Mar 2016 21:25:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adqIO-0003NH-Qz for qemu-devel@nongnu.org; Wed, 09 Mar 2016 21:25:48 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 5CA155275B for ; Thu, 10 Mar 2016 02:25:48 +0000 (UTC) Date: Thu, 10 Mar 2016 10:25:38 +0800 From: Peter Xu Message-ID: <20160310022538.GG4091@pxdev.xzpeter.org> References: <1457503813-31631-1-git-send-email-peterx@redhat.com> <1457503813-31631-2-git-send-email-peterx@redhat.com> <20160310015441.GF23632@ad.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160310015441.GF23632@ad.usersys.redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/2] usb: fix unbound stack usage for usb_mtp_add_str List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com On Thu, Mar 10, 2016 at 09:54:41AM +0800, Fam Zheng wrote: > On Wed, 03/09 14:10, Peter Xu wrote: > > + wchar_t *wstr = g_malloc(sizeof(wchar_t) * len); > > I think it is better to use g_new() in this case. Okay. Will re-send this one. Thanks. Peter