From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NF7As-0000gW-Gb for qemu-devel@nongnu.org; Mon, 30 Nov 2009 09:24:22 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NF7An-0000f7-Ms for qemu-devel@nongnu.org; Mon, 30 Nov 2009 09:24:22 -0500 Received: from [199.232.76.173] (port=42984 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NF7An-0000f2-Hy for qemu-devel@nongnu.org; Mon, 30 Nov 2009 09:24:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30936) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NF7An-00056k-9h for qemu-devel@nongnu.org; Mon, 30 Nov 2009 09:24:17 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAUEOFnt008245 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 30 Nov 2009 09:24:16 -0500 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nAUEOE3S026853 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 30 Nov 2009 09:24:15 -0500 Message-ID: <4B13D54E.5040803@redhat.com> Date: Mon, 30 Nov 2009 15:23:10 +0100 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Am 30.11.2009 14:55, schrieb Markus Armbruster: > Commit a7d27b53 made zero-sized allocations a fatal error, deviating > from ISO C's malloc() & friends. Revert that, but take care never to > return a null pointer, like malloc() & friends may do (it's > implementation defined), because that's another source of bugs. > > [...] > > Based on this sample, I'm confident there are many more uses broken by > the change. > > Signed-off-by: Markus Armbruster Acked-by: Kevin Wolf We really should fix the root cause once and for all instead of working around unexpected qemu_malloc behaviour each time when one of the time bombs has blown up another (possibly production) VM.