cvs: php-src /ext/gd/libgd gd_png.c
| From: | Pierre-Alain Joye | Date: | Wed, 11 Oct 2006 00:21:33 +0000 |
| Subject: | cvs: php-src /ext/gd/libgd gd_png.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-41055@lists.php.net to get a copy of this message | ||
pajoye Wed Oct 11 00:21:33 2006 UTC
Modified files:
/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.19&r2=1.20&diff_format=u
Index: php-src/ext/gd/libgd/gd_png.c
diff -u php-src/ext/gd/libgd/gd_png.c:1.19 php-src/ext/gd/libgd/gd_png.c:1.20
--- php-src/ext/gd/libgd/gd_png.c:1.19 Fri Jan 27 01:59:26 2006
+++ php-src/ext/gd/libgd/gd_png.c Wed Oct 11 00:21:33 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;
}