tony2001 Wed Oct 26 17:39:23 2005 EDT
Modified files: (Branch: PHP_5_0)
/php-src NEWS
/php-src/ext/gd gd.c
Log:
fix #34996 (ImageTrueColorToPalette() crashes when ncolors is zero)
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.506&r2=1.1760.2.507&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.506 php-src/NEWS:1.1760.2.507
--- php-src/NEWS:1.1760.2.506 Wed Oct 26 09:51:58 2005
+++ php-src/NEWS Wed Oct 26 17:39:20 2005
@@ -4,6 +4,8 @@
- Fixed an error in mysqli_fetch_fields (returned NULL instead of an
array when row number > field_count). (Georg)
- Renamed CachingRecursiveIterator to RecursiveCachingIterator. (Marcus)
+- Fixed bug #34996 (ImageTrueColorToPalette() crashes when ncolors is
+ zero). (Tony)
- Fixed bug #34977 (Compile failure on MacOSX due to use of varargs.h). (Tony)
- Fixed bug #34950 (Unable to get WSDL through proxy). (Dmitry)
- Fixed bug #34938 (dns_get_record() doesn't resolve long hostnames and
http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.294.2.13&r2=1.294.2.14&ty=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.294.2.13 php-src/ext/gd/gd.c:1.294.2.14
--- php-src/ext/gd/gd.c:1.294.2.13 Thu Oct 6 16:42:56 2005
+++ php-src/ext/gd/gd.c Wed Oct 26 17:39:22 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.294.2.13 2005/10/06 20:42:56 iliaa Exp $ */
+/* $Id: gd.c,v 1.294.2.14 2005/10/26 21:39:22 tony2001 Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -889,6 +889,10 @@
convert_to_boolean_ex(dither);
convert_to_long_ex(ncolors);
+ if (Z_LVAL_PP(ncolors) <= 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of colors
has to be greater than zero");
+ RETURN_FALSE;
+ }
gdImageTrueColorToPalette(im, Z_LVAL_PP(dither), Z_LVAL_PP(ncolors));
RETURN_TRUE;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php