summaryrefslogtreecommitdiff
path: root/graphics/php5-gd/files/patch-CVE-2009-3546
blob: 2010c6829504831890a2f9eca596db84f6e85b24 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
--- ./libgd/gd_gd.c.orig	2007-08-09 07:21:38.000000000 -0700
+++ ./libgd/gd_gd.c	2009-11-08 23:13:19.144908056 -0800
@@ -39,6 +39,9 @@
 			if (!gdGetWord(&im->colorsTotal, in)) {
 				goto fail1;
 			}
+			if (im->colorsTotal > gdMaxColors) {
+				goto fail1;
+			}
 		}
 		/* Int to accommodate truecolor single-color transparency */
 		if (!gdGetInt(&im->transparent, in)) {