From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db8FS-0006SB-Ny for qemu-devel@nongnu.org; Fri, 28 Jul 2017 12:36:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1db8FR-0002DP-UL for qemu-devel@nongnu.org; Fri, 28 Jul 2017 12:36:22 -0400 From: Markus Armbruster References: <20170728123127.27921-1-olaf@aepfle.de> <20170728124832.GP8603@aepfle.de> Date: Fri, 28 Jul 2017 18:35:57 +0200 In-Reply-To: <20170728124832.GP8603@aepfle.de> (Olaf Hering's message of "Fri, 28 Jul 2017 14:48:33 +0200") Message-ID: <87mv7oldsi.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] xen-disk: use g_malloc0 to fix build List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Olaf Hering Cc: Eric Blake , Kevin Wolf , Stefano Stabellini , "open list:Block layer core" , "open list:All patches CC here" , Max Reitz , Anthony Perard , "open list:X86" Olaf Hering writes: > On Fri, Jul 28, Eric Blake wrote: > >> This version is prone to multiplication overflow (well, maybe not, but >> you have to audit for that). Wouldn't it be better to use: > > What could go wrong? > qemu will die either way, I think. An overflow in the size argument of malloc(), realloc(), etc. is a heap overrun waiting to happen.