diff options
author | salo <salo@pkgsrc.org> | 2006-06-14 21:42:33 +0000 |
---|---|---|
committer | salo <salo@pkgsrc.org> | 2006-06-14 21:42:33 +0000 |
commit | 1d07100aaf40718df5ac7bf1a91287cf55182fc7 (patch) | |
tree | 9523b7a9ea93881b95391b987be8dca7ff9c50b6 | |
parent | e7230933bdc89dcb686a203d6b9a998ea8686084 (diff) | |
download | pkgsrc-1d07100aaf40718df5ac7bf1a91287cf55182fc7.tar.gz |
Security fix for CVE-2006-2906:
"The LZW decoding in the gdImageCreateFromGifPtr function in the Thomas
Boutell graphics draw (GD) library (aka libgd) 2.0.33 allows remote
attackers to cause a denial of service (CPU consumption) via malformed
GIF data that causes an infinite loop."
Patch from Xavier Roche via Ubuntu.
-rw-r--r-- | graphics/gd/Makefile | 4 | ||||
-rw-r--r-- | graphics/gd/distinfo | 3 | ||||
-rw-r--r-- | graphics/gd/patches/patch-ac | 65 |
3 files changed, 69 insertions, 3 deletions
diff --git a/graphics/gd/Makefile b/graphics/gd/Makefile index f8cbbe6b54c..62f23408cb5 100644 --- a/graphics/gd/Makefile +++ b/graphics/gd/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.69 2006/05/14 18:22:38 minskim Exp $ +# $NetBSD: Makefile,v 1.70 2006/06/14 21:42:33 salo Exp $ DISTNAME= gd-2.0.33 -PKGREVISION= 4 +PKGREVISION= 5 CATEGORIES= graphics MASTER_SITES= http://www.boutell.com/gd/http/ diff --git a/graphics/gd/distinfo b/graphics/gd/distinfo index 5a556cee191..a0933878d01 100644 --- a/graphics/gd/distinfo +++ b/graphics/gd/distinfo @@ -1,7 +1,8 @@ -$NetBSD: distinfo,v 1.22 2005/06/06 18:38:08 minskim Exp $ +$NetBSD: distinfo,v 1.23 2006/06/14 21:42:33 salo Exp $ SHA1 (gd-2.0.33.tar.gz) = 89548efb01116a740c796a8df80de16d19856811 RMD160 (gd-2.0.33.tar.gz) = 6c573638387bb36044f3d4d480b10229445b9a6b Size (gd-2.0.33.tar.gz) = 587617 bytes SHA1 (patch-aa) = 38f0aa7043dba517405312d4eef59347e3c0185a SHA1 (patch-ab) = 082f5baa2c147fb62381c21ecb3ce11a1891a2aa +SHA1 (patch-ac) = 154abdaff73099617a1b57f4d2f19358aaf2a043 diff --git a/graphics/gd/patches/patch-ac b/graphics/gd/patches/patch-ac new file mode 100644 index 00000000000..c24ea41f312 --- /dev/null +++ b/graphics/gd/patches/patch-ac @@ -0,0 +1,65 @@ +$NetBSD: patch-ac,v 1.3 2006/06/14 21:42:33 salo Exp $ + +Security fix for CVE-2006-2906, from Xavier Roche via Ubuntu. + +--- gd_gif_in.c.orig 2004-11-01 19:28:56.000000000 +0100 ++++ gd_gif_in.c 2006-06-14 23:30:38.000000000 +0200 +@@ -118,6 +118,7 @@ + char version[4]; + /* 2.0.28: threadsafe storage */ + int ZeroDataBlock = FALSE; ++ int maxcount = 1024; + + gdImagePtr im = 0; + if (! ReadOK(fd,buf,6)) { +@@ -164,6 +165,8 @@ + } + + if (c != ',') { /* Not a valid start character */ ++ if (--maxcount < 0) ++ goto terminated; /* Looping */ + continue; + } + +@@ -242,6 +245,7 @@ + DoExtension(gdIOCtx *fd, int label, int *Transparent, int *ZeroDataBlockP) + { + static unsigned char buf[256]; ++ int maxcount = 1024; + + switch (label) { + case 0xf9: /* Graphic Control Extension */ +@@ -254,13 +258,13 @@ + if ((buf[0] & 0x1) != 0) + *Transparent = buf[3]; + +- while (GetDataBlock(fd, (unsigned char*) buf, ZeroDataBlockP) != 0) ++ while (GetDataBlock(fd, (unsigned char*) buf, ZeroDataBlockP) != 0 && --maxcount >= 0) + ; + return FALSE; + default: + break; + } +- while (GetDataBlock(fd, (unsigned char*) buf, ZeroDataBlockP) != 0) ++ while (GetDataBlock(fd, (unsigned char*) buf, ZeroDataBlockP) != 0 && --maxcount >= 0) + ; + + return FALSE; +@@ -419,14 +423,15 @@ + } else if (code == end_code) { + int count; + unsigned char buf[260]; ++ int maxcount = 1024; + + if (*ZeroDataBlockP) + return -2; + +- while ((count = GetDataBlock(fd, buf, ZeroDataBlockP)) > 0) ++ while ((count = GetDataBlock(fd, buf, ZeroDataBlockP)) > 0 && --maxcount >= 0) + ; + +- if (count != 0) ++ if (count != 0 || maxcount < 0) + return -2; + } + |