Security fix for gd remote buffer overflow vulnerability.

PR:		ports/147163
Submitted by:	Michael Ranner <michael@ranner.eu>
This commit is contained in:
Alex Dupre 2010-06-14 14:43:44 +00:00
parent 7012ce9f37
commit 542b78d08d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=256526
2 changed files with 13 additions and 0 deletions

View file

@ -5,6 +5,7 @@
# $FreeBSD$
#
PORTREVISION= 4
CATEGORIES= graphics
MASTERDIR= ${.CURDIR}/../../lang/php4

View file

@ -0,0 +1,12 @@
--- libgd/gd_gd.c.orig 2010-03-26 14:26:22.000000000 +0100
+++ libgd/gd_gd.c 2010-03-26 14:28:03.000000000 +0100
@@ -40,6 +40,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)) {