CVE-2006-2906 has been fixed upstream another way; this patch is unneeded

This commit is contained in:
drochner 2007-02-22 17:21:18 +00:00
parent ce8ae05e7a
commit 279974b31d
2 changed files with 1 additions and 65 deletions

View file

@ -1,8 +1,7 @@
$NetBSD: distinfo,v 1.25 2007/02/17 07:04:44 adam Exp $
$NetBSD: distinfo,v 1.26 2007/02/22 17:21:18 drochner Exp $
SHA1 (gd-2.0.34.tar.bz2) = 7d735b2917f987dd71ddbb72e9e100b2f8951de7
RMD160 (gd-2.0.34.tar.bz2) = 88b1d298e3392c5c05acf2cd01b387d7e0d2bfae
Size (gd-2.0.34.tar.bz2) = 1135372 bytes
SHA1 (patch-aa) = 38f0aa7043dba517405312d4eef59347e3c0185a
SHA1 (patch-ab) = 082f5baa2c147fb62381c21ecb3ce11a1891a2aa
SHA1 (patch-ac) = 1e0dbdc6a2ad56ec947cd694749049ff26014e82

View file

@ -1,63 +0,0 @@
$NetBSD: patch-ac,v 1.5 2007/02/17 07:04:45 adam Exp $
--- gd_gif_in.c.orig 2007-02-03 02:41:00.000000000 +0100
+++ gd_gif_in.c
@@ -118,6 +118,7 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFro
char version[4];
/* 2.0.28: threadsafe storage */
int ZeroDataBlock = FALSE;
+ int maxcount = 1024;
gdImagePtr im = 0;
if (! ReadOK(fd,buf,6)) {
@@ -166,6 +167,8 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFro
}
if (c != ',') { /* Not a valid start character */
+ if (--maxcount < 0)
+ goto terminated; /* Looping */
continue;
}
@@ -253,6 +256,7 @@ static int
DoExtension(gdIOCtx *fd, int label, int *Transparent, int *ZeroDataBlockP)
{
static unsigned char buf[256];
+ int maxcount = 1024;
switch (label) {
case 0xf9: /* Graphic Control Extension */
@@ -265,13 +269,13 @@ DoExtension(gdIOCtx *fd, int label, int
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;
@@ -430,14 +434,15 @@ LWZReadByte_(gdIOCtx *fd, int flag, int
} 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;
}