From: Mike Frysinger Date: Sun, 1 Apr 2012 23:10:03 -0400 Subject: [U-Boot] [PATCH] Prevent malloc with size 0 In-Reply-To: References: <4CC006B1.8000905@intracomdefense.com> <201204011621.46057.marek.vasut@gmail.com> Message-ID: <201204012310.05235.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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: