cvs: php4 /ext/gd gd.c
| From: | Ilia Alshanetsky | Date: | Fri, 04 Apr 2003 00:16:48 +0000 |
| Subject: | cvs: php4 /ext/gd gd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20057@lists.php.net to get a copy of this message | ||
iliaa Thu Apr 3 19:16:48 2003 EDT
Modified files:
/php4/ext/gd gd.c
Log:
Fix segfault in imagecopyresized().
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.264 php4/ext/gd/gd.c:1.265
--- php4/ext/gd/gd.c:1.264 Thu Apr 3 19:09:23 2003
+++ php4/ext/gd/gd.c Thu Apr 3 19:16:47 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.264 2003/04/04 00:09:23 sniper Exp $ */
+/* $Id: gd.c,v 1.265 2003/04/04 00:16:47 iliaa Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -2946,6 +2946,11 @@
dstY = Z_LVAL_PP(DY);
dstH = Z_LVAL_PP(DH);
dstW = Z_LVAL_PP(DW);
+
+ if (dstW < 0 || dstH < 0 || srcW < 0 || srcH < 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions");
+ RETURN_FALSE;
+ }
gdImageCopyResized(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH);
RETURN_TRUE;