Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > ace0c7d5943399be8235d684d03fb2e5 > files > 20

freetype-2.2.1-28.el5_7.1.src.rpm

--- freetype-2.2.1/src/base/ftutil.c.zero-size	2006-05-02 14:47:14.000000000 -0700
+++ freetype-2.2.1/src/base/ftutil.c	2006-11-04 19:44:36.000000000 -0800
@@ -120,12 +120,16 @@
     FT_Error  error = FT_Err_Ok;
 
 
-    if ( cur_count < 0 || new_count < 0 || item_size <= 0 )
+    /* Note that we now accept `item_size == 0' as a valid parameter, in
+     * order to cover very weird cases where an ALLOC_MULT macro would be
+     * called.
+     */
+    if ( cur_count < 0 || new_count < 0 || item_size < 0 )
     {
       /* may help catch/prevent nasty security issues */
       error = FT_Err_Invalid_Argument;
     }
-    else if ( new_count == 0 )
+    else if ( new_count == 0 || item_size == 0 )
     {
       ft_mem_free( memory, block );
       block = NULL;