[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH for-4.0 0/9] ppc: get rid of g_malloc(sizeof(T) *

From: David Gibson
Subject: Re: [Qemu-ppc] [PATCH for-4.0 0/9] ppc: get rid of g_malloc(sizeof(T) * n)
Date: Wed, 28 Nov 2018 09:54:03 +1100
User-agent: Mutt/1.10.1 (2018-07-13)

On Tue, Nov 27, 2018 at 02:04:53PM +0100, Greg Kurz wrote:
> As explained in HACKING, the g_malloc(sizeof(T) * n) construct is unsafe
> because it can't detect multiplication overflowing size_t and doesn't
> allow type checking.
> It appears to be used in a bunch of places though:
> $ git grep -E 'malloc.*sizeof' | grep ' \* '  | wc -l
> 101
> This series fixes the ppc target and ppc machine code. The changes are
> mostly trivial. Only the mac99 and e500 machines required some more work
> that should be reviewed carefully, as it was only compile-tested.

Series applied, thanks.

David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]