cvs: gd(GD_2_0) /libgd gd.c

[email protected] ("Mattias Bengtsson") Wed, 08 Aug 2007 16:58:09 -0000
Newsgroups php.gd.cvs
Message-ID <cvsmattias1186592289@cvsserver>
mattias		Wed Aug  8 16:58:09 2007 UTC

  Modified files:              (Branch: GD_2_0)
    /gd/libgd	gd.c 
  Log:
  #109, 2.0 are diffrent than HEAD and require more checking
  
http://cvs.php.net/viewvc.cgi/gd/libgd/gd.c?r1=1.49.2.17&r2=1.49.2.18&diff_format=u
Index: gd/libgd/gd.c
diff -u gd/libgd/gd.c:1.49.2.17 gd/libgd/gd.c:1.49.2.18
--- gd/libgd/gd.c:1.49.2.17	Wed Aug  8 12:57:46 2007
+++ gd/libgd/gd.c	Wed Aug  8 16:58:08 2007
@@ -1,4 +1,4 @@
-/* $Id: gd.c,v 1.49.2.17 2007/08/08 12:57:46 mattias Exp $ */
+/* $Id: gd.c,v 1.49.2.18 2007/08/08 16:58:08 mattias Exp $ */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -2028,6 +2028,18 @@
 	wx2=im->sx;wy2=im->sy;
 	tiled = nc==gdTiled;
 
+	if(overflow2(sizeof(int *), im->sy)) {
+		return;
+	}
+
+	if(overflow2((sizeof(int *) * im->sy), sizeof(int))) {
+		return;
+	}
+
+	if(overflow2(im->sx, sizeof(int))) {
+		return;
+	}
+
 	if(overflow2(im->sy, im->sx)) {
 		return;
 	}