Re: [Xen-devel] [Qemu-devel] [PATCH] xen-disk: use g_malloc0 to fix build

2017-07-28 Thread Markus Armbruster
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 mal

Re: [Xen-devel] [Qemu-devel] [PATCH] xen-disk: use g_malloc0 to fix build

2017-07-28 Thread Eric Blake
On 07/28/2017 07:48 AM, Olaf Hering wrote: > 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. Dying immediatel

Re: [Xen-devel] [Qemu-devel] [PATCH] xen-disk: use g_malloc0 to fix build

2017-07-28 Thread Daniel P. Berrange
On Fri, Jul 28, 2017 at 07:43:59AM -0500, Eric Blake wrote: > On 07/28/2017 07:31 AM, Olaf Hering wrote: > > g_malloc0_n is available since glib-2.24. To allow build with older glib > > versions use the generic g_malloc0, which is already used in many other > > places in the code. > > > > Fixes co

Re: [Xen-devel] [Qemu-devel] [PATCH] xen-disk: use g_malloc0 to fix build

2017-07-28 Thread Olaf Hering
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. Olaf signature.asc Description: PGP signature ___

Re: [Xen-devel] [Qemu-devel] [PATCH] xen-disk: use g_malloc0 to fix build

2017-07-28 Thread Eric Blake
On 07/28/2017 07:31 AM, Olaf Hering wrote: > g_malloc0_n is available since glib-2.24. To allow build with older glib > versions use the generic g_malloc0, which is already used in many other > places in the code. > > Fixes commit 3284fad728 ("xen-disk: add support for multi-page shared rings") >