diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-12-21 01:55:23 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-12-21 01:55:23 +0000 |
commit | 1d1dd4e470bf35064541b091030b33434d3b7cc3 (patch) | |
tree | 72fda59bd99905a063171f3b91fa0d43d29275a2 /media-libs/gd | |
parent | old (diff) | |
download | historical-1d1dd4e470bf35064541b091030b33434d3b7cc3.tar.gz historical-1d1dd4e470bf35064541b091030b33434d3b7cc3.tar.bz2 historical-1d1dd4e470bf35064541b091030b33434d3b7cc3.zip |
Add some sanity checks to prevent overflows #112937.
Package-Manager: portage-2.0.53
Diffstat (limited to 'media-libs/gd')
-rw-r--r-- | media-libs/gd/ChangeLog | 8 | ||||
-rw-r--r-- | media-libs/gd/Manifest | 10 | ||||
-rw-r--r-- | media-libs/gd/files/digest-gd-2.0.33 | 1 | ||||
-rw-r--r-- | media-libs/gd/files/gd-2.0.33-overflow-checks.patch | 49 | ||||
-rw-r--r-- | media-libs/gd/gd-2.0.33.ebuild | 43 |
5 files changed, 110 insertions, 1 deletions
diff --git a/media-libs/gd/ChangeLog b/media-libs/gd/ChangeLog index d2db9b39bd54..be4bd24b5025 100644 --- a/media-libs/gd/ChangeLog +++ b/media-libs/gd/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for media-libs/gd # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-libs/gd/ChangeLog,v 1.22 2005/12/13 05:31:26 spyderous Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-libs/gd/ChangeLog,v 1.23 2005/12/21 01:55:23 vapier Exp $ + +*gd-2.0.33 (21 Dec 2005) + + 21 Dec 2005; Mike Frysinger <vapier@gentoo.org> + +files/gd-2.0.33-overflow-checks.patch, +gd-2.0.33.ebuild: + Add some sanity checks to prevent overflows #112937. 13 Dec 2005; Donnie Berkholz <spyderous@gentoo.org>; gd-2.0.32.ebuild: Add modular X dependencies. diff --git a/media-libs/gd/Manifest b/media-libs/gd/Manifest index fe778a6741c4..a4de51f4e54e 100644 --- a/media-libs/gd/Manifest +++ b/media-libs/gd/Manifest @@ -1,3 +1,6 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + MD5 5eba6e91828c55eb79d08dcf8a44b132 ChangeLog 9096 MD5 ef1f623ab65a05b7e14e9bd61bb02c65 files/digest-gd-2.0.32 61 MD5 ba0985339b94b8c354d8e3246b8972e0 files/digest-gd-2.0.33 61 @@ -5,3 +8,10 @@ MD5 e87c929b6ea7468d13cc8f2e176f6aaa files/gd-2.0.33-overflow-checks.patch 1382 MD5 dd997b3de3bba1b67bb918160d090224 gd-2.0.32.ebuild 1015 MD5 12f5778750774ba45dddd69f7daeaba1 gd-2.0.33.ebuild 1092 MD5 312563b7288a2111976b24b0865d9df8 metadata.xml 1227 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.2 (GNU/Linux) + +iD4DBQFDqLY62+ySkm8kpY0RAg8DAJ9nl4cbbOBDDiQfNCCQyJM2hbw1VwCWIVZ/ +UyESzXA6RfWWYCzIxZEVRw== +=KDZo +-----END PGP SIGNATURE----- diff --git a/media-libs/gd/files/digest-gd-2.0.33 b/media-libs/gd/files/digest-gd-2.0.33 new file mode 100644 index 000000000000..0fae85af693b --- /dev/null +++ b/media-libs/gd/files/digest-gd-2.0.33 @@ -0,0 +1 @@ +MD5 be0a6d326cd8567e736fbc75df0a5c45 gd-2.0.33.tar.gz 587617 diff --git a/media-libs/gd/files/gd-2.0.33-overflow-checks.patch b/media-libs/gd/files/gd-2.0.33-overflow-checks.patch new file mode 100644 index 000000000000..6a028a13093d --- /dev/null +++ b/media-libs/gd/files/gd-2.0.33-overflow-checks.patch @@ -0,0 +1,49 @@ +add some sanity checks to prevent integer overflows when +allocating memory for big images + +http://bugs.gentoo.org/112937 + +--- gd/gd.c ++++ gd/gd.c +@@ -74,6 +74,10 @@ BGD_DECLARE(gdImagePtr) gdImageCreate (i + im = (gdImage *) gdMalloc (sizeof (gdImage)); + memset (im, 0, sizeof (gdImage)); + /* Row-major ever since gd 1.3 */ ++ if (overflow2(sizeof (unsigned char *), sy)) { ++ gdFree(im); ++ return NULL; ++ } + im->pixels = (unsigned char **) gdMalloc (sizeof (unsigned char *) * sy); + im->polyInts = 0; + im->polyAllocated = 0; +@@ -114,6 +118,10 @@ BGD_DECLARE(gdImagePtr) gdImageCreateTru + gdImagePtr im; + im = (gdImage *) gdMalloc (sizeof (gdImage)); + memset (im, 0, sizeof (gdImage)); ++ if (overflow2(sizeof (int *), sy)) { ++ gdFree(im); ++ return NULL; ++ } + im->tpixels = (int **) gdMalloc (sizeof (int *) * sy); + im->polyInts = 0; + im->polyAllocated = 0; +@@ -2462,6 +2470,8 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFro + } + bytes = (w * h / 8) + 1; + im = gdImageCreate (w, h); ++ if (!im) ++ return 0; + gdImageColorAllocate (im, 255, 255, 255); + gdImageColorAllocate (im, 0, 0, 0); + x = 0; +--- gd/gd_gd.c ++++ gd/gd_gd.c +@@ -149,6 +149,8 @@ _gdCreateFromFile (gdIOCtx * in, int *sx + { + im = gdImageCreate (*sx, *sy); + } ++ if (!im) ++ goto fail1; + if (!_gdGetColors (in, im, gd2xFlag)) + { + goto fail2; diff --git a/media-libs/gd/gd-2.0.33.ebuild b/media-libs/gd/gd-2.0.33.ebuild new file mode 100644 index 000000000000..3c036172c43a --- /dev/null +++ b/media-libs/gd/gd-2.0.33.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-libs/gd/gd-2.0.33.ebuild,v 1.1 2005/12/21 01:55:23 vapier Exp $ + +inherit eutils + +DESCRIPTION="A graphics library for fast image creation" +HOMEPAGE="http://www.boutell.com/gd/" +SRC_URI="http://www.boutell.com/gd/http/${P}.tar.gz" + +LICENSE="|| ( as-is BSD )" +SLOT="2" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~ppc-macos ~s390 ~sparc ~x86" +IUSE="fontconfig jpeg png X truetype" + +DEPEND="fontconfig? ( media-libs/fontconfig ) + jpeg? ( >=media-libs/jpeg-6b ) + png? ( >=media-libs/libpng-1.2.5 sys-libs/zlib ) + truetype? ( >=media-libs/freetype-2.1.5 ) + X? ( virtual/x11 )" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${P}-overflow-checks.patch +} + +src_compile() { + econf \ + $(use_with fontconfig) \ + $(use_with png) \ + $(use_with truetype freetype) \ + $(use_with jpeg) \ + $(use_with X xpm) \ + || die + emake || die +} + +src_install() { + make DESTDIR="${D}" install || die + dodoc INSTALL README* + dohtml -r ./ +} |