summaryrefslogtreecommitdiff
path: root/graphics/gd/files/patch-cve-2009-3546
blob: f483039105b837244e0362ab12c28d3eeacbe0fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Adopted-From: http://svn.php.net/viewvc/php/php-src/branches/PHP_5_2/ext/gd/libgd/gd_gd.c?r1=289557&r2=289556&pathrev=289557&view=patch

--- gd_gd.c.orig	2006-04-05 19:52:22.000000000 +0400
+++ gd_gd.c	2009-11-06 18:06:50.000000000 +0300
@@ -44,6 +44,10 @@
 	    {
 	      goto fail1;
 	    }
+	  if (im->colorsTotal > gdMaxColors)
+	    {
+	      goto fail1;
+	    }
 	}
       /* Int to accommodate truecolor single-color transparency */
       if (!gdGetInt (&im->transparent, in))