[U-Boot] [PATCH] Prevent malloc with size 0

Mike Frysinger vapier at gentoo.org
Mon Apr 2 05:10:03 CEST 2012


On Sunday 01 April 2012 18:40:05 Graeme Russ wrote:
>         if ((long)bytes == 0) {
>                 DEBUG("Warning: malloc of zero block size\n");
>                 bytes = 1;
>         } else if ((long)bytes < 0) {
>                 DEBUG("Error: malloc of negative block size\n");
>                 return 0;
>         }

this should be (ssize_t) casts, not (long)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120401/205427d2/attachment.pgp>


More information about the U-Boot mailing list