Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVO3R-00014s-1x for qemu-devel@nongnu.org; Fri, 06 Feb 2009 05:35:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVO3N-00012V-6h for qemu-devel@nongnu.org; Fri, 06 Feb 2009 05:35:23 -0500 Received: from [199.232.76.173] (port=35912 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVO3M-00012M-Ri for qemu-devel@nongnu.org; Fri, 06 Feb 2009 05:35:20 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:6029) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LVO3M-0003lq-H2 for qemu-devel@nongnu.org; Fri, 06 Feb 2009 05:35:20 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18828.4707.398109.841443@mariner.uk.xensource.com> Date: Fri, 6 Feb 2009 10:35:15 +0000 Subject: Re: [Qemu-devel] [PATCH 1/5] usb-linux.c: allow full-size control transfers, do not overrun buffer In-Reply-To: References: <6f129132214575f261cb44404f901281ad6bd699.1233854876.git.Ian.Jackson@eu.citrix.com> From: Ian Jackson Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: qemu-devel@nongnu.org malc writes ("Re: [Qemu-devel] [PATCH 1/5] usb-linux.c: allow full-size control transfers, do not overrun buffer"): > On Tue, 3 Feb 2009, Ian Jackson wrote: > > +#if defined(__linux__) > > And endif is... (Leaving aside the fact that __linux__ guard in a file > called something-linux.c is a weird looking thing) I don't know how that got there. It's a mistake. Sorry. I'll redo the patch ... > > + assert(s->ctrl.len < sizeof(s->ctrl.buffer)); > > + > > If something can happen it will, if assert can turn into a nop it will do > so also, `if (cond) abort();' is more apropriate. assert is used a lot on the rest of qemu so I assumed it was sensible to use it here. Anyone who compiles qemu with -DNDEBUG deserves what they get, I think. Ian.