From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adq0o-0001ho-2q for qemu-devel@nongnu.org; Wed, 09 Mar 2016 21:07:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adq0k-0007Bh-Qb for qemu-devel@nongnu.org; Wed, 09 Mar 2016 21:07:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adq0k-0007Bc-Lt for qemu-devel@nongnu.org; Wed, 09 Mar 2016 21:07:34 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 5722A64D0F for ; Thu, 10 Mar 2016 02:07:34 +0000 (UTC) Date: Thu, 10 Mar 2016 10:07:26 +0800 From: Peter Xu Message-ID: <20160310020726.GF4091@pxdev.xzpeter.org> References: <1457420446-25276-1-git-send-email-peterx@redhat.com> <1457420446-25276-5-git-send-email-peterx@redhat.com> <56DEC3E0.1010404@redhat.com> <20160309050812.GK2377@pxdev.xzpeter.org> <56DFD66F.9030900@redhat.com> <20160309080750.GR2377@pxdev.xzpeter.org> <56E01E17.6000508@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <56E01E17.6000508@redhat.com> Subject: Re: [Qemu-devel] [PATCH 4/8] usb: fix unbounded stack for xhci_dma_write_u32s List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Gerd Hoffmann On Wed, Mar 09, 2016 at 01:59:03PM +0100, Paolo Bonzini wrote: > If you look at users, they only write about 20 bytes at most. My > suggestion is to use your patch, and replace > > assert(__BUF_SIZE >= n); > > with > > assert(n < ARRAY_SIZE(tmp)); > > Then you don't need the #define. Okay. Will fix and post another one. Thanks. Peter