pajoye Wed Oct 11 00:19:12 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/gd/libgd gd_png.c Log: - don't check signature if the file is empty (valgrind reports with test 001), thx Tony for the head up http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd_png.c?r1=1.17.4.2&r2=1.17.4.2.2.1&diff_format=u Index: php-src/ext/gd/libgd/gd_png.c diff -u php-src/ext/gd/libgd/gd_png.c:1.17.4.2 php-src/ext/gd/libgd/gd_png.c:1.17.4.2.2.1 --- php-src/ext/gd/libgd/gd_png.c:1.17.4.2 Fri Jan 27 13:36:30 2006 +++ php-src/ext/gd/libgd/gd_png.c Wed Oct 11 00:19:12 2006 @@ -131,7 +131,10 @@ /* first do a quick check that the file really is a PNG image; could * have used slightly more general png_sig_cmp() function instead */ - gdGetBuf(sig, 8, infile); + if (gdGetBuf(sig, 8, infile) < 8) { + return NULL; + } + if (!png_check_sig (sig, 8)) { /* bad signature */ return NULL; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php