nlopess Fri Mar 2 18:41:25 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/gd/libgd gd_gif_in.c
Log:
fix access to non initialized memory (check valgrind reports on
http://gcov.php.net)
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.5.4.2.2.7&r2=1.5.4.2.2.8&diff_format=u
Index: php-src/ext/gd/libgd/gd_gif_in.c
diff -u php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.7
php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.8
--- php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.7 Sat Feb 24 17:59:45 2007
+++ php-src/ext/gd/libgd/gd_gif_in.c Fri Mar 2 18:41:25 2007
@@ -121,7 +121,6 @@
int bitPixel;
int i;
/*1.4//int imageCount = 0; */
- char version[4];
gdImagePtr im = 0;
ZeroDataBlock = FALSE;
@@ -133,9 +132,8 @@
if (strncmp((char *)buf,"GIF",3) != 0) {
return 0;
}
- strlcpy(version, (char *)buf + 3, sizeof(version));
- if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0)) {
+ if ((strncmp((char*)buf+3, "87a", 3) != 0) && (strncmp((char*)buf+3,
"89a", 3) != 0)) {
return 0;
}
if (! ReadOK(fd,buf,7)) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php