Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHCPo-0002Tr-At for qemu-devel@nongnu.org; Sun, 06 Dec 2009 03:24:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHCPj-0002Rn-9j for qemu-devel@nongnu.org; Sun, 06 Dec 2009 03:24:23 -0500 Received: from [199.232.76.173] (port=39219 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHCPj-0002Rk-4B for qemu-devel@nongnu.org; Sun, 06 Dec 2009 03:24:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:3473) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHCPi-0002ve-Oi for qemu-devel@nongnu.org; Sun, 06 Dec 2009 03:24:19 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends References: <4B193DA5.6040507@codemonkey.ws> <4B1A9359.8080305@redhat.com> <4B1A9811.8020108@codemonkey.ws> <4B1A9AF9.8000107@redhat.com> <4B1A9E39.2030602@codemonkey.ws> <4B1AA110.8030600@redhat.com> <4B1AC96B.7060007@codemonkey.ws> <4B1ADE14.2070809@redhat.com> Date: Sun, 06 Dec 2009 09:24:07 +0100 In-Reply-To: <4B1ADE14.2070809@redhat.com> (Avi Kivity's message of "Sun, 06 Dec 2009 00:26:28 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org, Paul Brook Avi Kivity writes: > A NEW(type) and ARRAY_NEW(type, count) marcros would improve type > safety and plug a dormant buffer overflow due to multiplication > overflow, yes. Even qemu_calloc() would be an improvement. But > having qemu_malloc() not fix the zero length array case which we know > we have is irresponsible, IMO. Agree on all counts.