mattias         Thu Aug  9 12:08:29 2007 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/gd/tests       libgd00094.phpt libgd00094.xbm 

  Modified files:              
    /php-src/ext/gd/libgd       xbm.c 
  Log:
  - libgd #94, imagecreatefromxbm can crash if gdImageCreate fails
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/xbm.c?r1=1.7.2.2.2.1&r2=1.7.2.2.2.2&diff_format=u
Index: php-src/ext/gd/libgd/xbm.c
diff -u php-src/ext/gd/libgd/xbm.c:1.7.2.2.2.1 
php-src/ext/gd/libgd/xbm.c:1.7.2.2.2.2
--- php-src/ext/gd/libgd/xbm.c:1.7.2.2.2.1      Mon Jan  1 09:36:01 2007
+++ php-src/ext/gd/libgd/xbm.c  Thu Aug  9 12:08:29 2007
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: xbm.c,v 1.7.2.2.2.1 2007/01/01 09:36:01 sebastian Exp $ */
+/* $Id: xbm.c,v 1.7.2.2.2.2 2007/08/09 12:08:29 mattias Exp $ */
 
 #include <stdio.h>
 #include <math.h>
@@ -96,7 +96,9 @@
                return 0;
        }
 
-       im = gdImageCreate(width, height);
+       if(!(im = gdImageCreate(width, height))) {
+               return 0;
+       }
        gdImageColorAllocate(im, 255, 255, 255);
        gdImageColorAllocate(im, 0, 0, 0);
        h[2] = '\0';

http://cvs.php.net/viewvc.cgi/php-src/ext/gd/tests/libgd00094.phpt?view=markup&rev=1.1
Index: php-src/ext/gd/tests/libgd00094.phpt
+++ php-src/ext/gd/tests/libgd00094.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/gd/tests/libgd00094.xbm?view=markup&rev=1.1
Index: php-src/ext/gd/tests/libgd00094.xbm
+++ php-src/ext/gd/tests/libgd00094.xbm

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to