summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-03-12 00:26:31 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-03-12 00:26:31 +0000
commit09d05ff04856fed02e2cfa9a8a8b72e1074a59b4 (patch)
tree4e0612ba554b903b35e1a3ec5b9e97c8b1c04fe2 /sys
parent1e1ccbf8f1be5a063a5e89a8019bbc6bb12c5fb1 (diff)
Update to zlib-1.1.4
Diffstat (limited to 'sys')
-rw-r--r--sys/lib/libz/adler32.c4
-rw-r--r--sys/lib/libz/crc32.c4
-rw-r--r--sys/lib/libz/infblock.c3
-rw-r--r--sys/lib/libz/infblock.h3
-rw-r--r--sys/lib/libz/infcodes.c13
-rw-r--r--sys/lib/libz/infcodes.h3
-rw-r--r--sys/lib/libz/inffast.c48
-rw-r--r--sys/lib/libz/inffast.h3
-rw-r--r--sys/lib/libz/inffixed.h1
-rw-r--r--sys/lib/libz/inflate.c3
-rw-r--r--sys/lib/libz/inftrees.c10
-rw-r--r--sys/lib/libz/inftrees.h3
-rw-r--r--sys/lib/libz/infutil.c3
-rw-r--r--sys/lib/libz/infutil.h3
-rw-r--r--sys/lib/libz/zconf.h4
-rw-r--r--sys/lib/libz/zlib.h7
-rw-r--r--sys/lib/libz/zutil.h4
17 files changed, 69 insertions, 50 deletions
diff --git a/sys/lib/libz/adler32.c b/sys/lib/libz/adler32.c
index 166a918e488..a943719c371 100644
--- a/sys/lib/libz/adler32.c
+++ b/sys/lib/libz/adler32.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: adler32.c,v 1.5 2000/03/03 00:54:57 todd Exp $ */
+/* $OpenBSD: adler32.c,v 1.6 2002/03/12 00:26:30 millert Exp $ */
/* adler32.c -- compute the Adler-32 checksum of a data stream
- * Copyright (C) 1995-1998 Mark Adler
+ * Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
diff --git a/sys/lib/libz/crc32.c b/sys/lib/libz/crc32.c
index d46ea2ccb9f..c1fe7249cba 100644
--- a/sys/lib/libz/crc32.c
+++ b/sys/lib/libz/crc32.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: crc32.c,v 1.7 2000/03/03 00:54:57 todd Exp $ */
+/* $OpenBSD: crc32.c,v 1.8 2002/03/12 00:26:30 millert Exp $ */
/* crc32.c -- compute the CRC-32 of a data stream
- * Copyright (C) 1995-1998 Mark Adler
+ * Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
diff --git a/sys/lib/libz/infblock.c b/sys/lib/libz/infblock.c
index df9eb431f51..a47c923136d 100644
--- a/sys/lib/libz/infblock.c
+++ b/sys/lib/libz/infblock.c
@@ -1,5 +1,6 @@
+/* $OpenBSD: infblock.c,v 1.9 2002/03/12 00:26:30 millert Exp $ */
/* infblock.c -- interpret and process block types to last block
- * Copyright (C) 1995-1998 Mark Adler
+ * Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
diff --git a/sys/lib/libz/infblock.h b/sys/lib/libz/infblock.h
index bd25c807536..fdb321892b1 100644
--- a/sys/lib/libz/infblock.h
+++ b/sys/lib/libz/infblock.h
@@ -1,5 +1,6 @@
+/* $OpenBSD: infblock.h,v 1.5 2002/03/12 00:26:30 millert Exp $ */
/* infblock.h -- header to use infblock.c
- * Copyright (C) 1995-1998 Mark Adler
+ * Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
diff --git a/sys/lib/libz/infcodes.c b/sys/lib/libz/infcodes.c
index b472fba3226..6c26c7039a2 100644
--- a/sys/lib/libz/infcodes.c
+++ b/sys/lib/libz/infcodes.c
@@ -1,5 +1,6 @@
+/* $OpenBSD: infcodes.c,v 1.6 2002/03/12 00:26:30 millert Exp $ */
/* infcodes.c -- process literals and length/distance pairs
- * Copyright (C) 1995-1998 Mark Adler
+ * Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -196,15 +197,9 @@ int r;
Tracevv(("inflate: distance %u\n", c->sub.copy.dist));
c->mode = COPY;
case COPY: /* o: copying bytes in window, waiting for space */
-#ifndef __TURBOC__ /* Turbo C bug for following expression */
- f = (uInt)(q - s->window) < c->sub.copy.dist ?
- s->end - (c->sub.copy.dist - (q - s->window)) :
- q - c->sub.copy.dist;
-#else
f = q - c->sub.copy.dist;
- if ((uInt)(q - s->window) < c->sub.copy.dist)
- f = s->end - (c->sub.copy.dist - (uInt)(q - s->window));
-#endif
+ while (f < s->window) /* modulo window size-"while" instead */
+ f += s->end - s->window; /* of "if" handles invalid distances */
while (c->len)
{
NEEDOUT
diff --git a/sys/lib/libz/infcodes.h b/sys/lib/libz/infcodes.h
index 6c750d896f9..99b37f8d813 100644
--- a/sys/lib/libz/infcodes.h
+++ b/sys/lib/libz/infcodes.h
@@ -1,5 +1,6 @@
+/* $OpenBSD: infcodes.h,v 1.5 2002/03/12 00:26:30 millert Exp $ */
/* infcodes.h -- header to use infcodes.c
- * Copyright (C) 1995-1998 Mark Adler
+ * Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
diff --git a/sys/lib/libz/inffast.c b/sys/lib/libz/inffast.c
index 72228af9184..c033947b04d 100644
--- a/sys/lib/libz/inffast.c
+++ b/sys/lib/libz/inffast.c
@@ -1,5 +1,6 @@
+/* $OpenBSD: inffast.c,v 1.6 2002/03/12 00:26:30 millert Exp $ */
/* inffast.c -- process literals and length/distance pairs fast
- * Copyright (C) 1995-1998 Mark Adler
+ * Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -93,28 +94,41 @@ z_streamp z;
/* do the copy */
m -= c;
- if ((uInt)(q - s->window) >= d) /* offset before dest */
- { /* just copy */
- r = q - d;
- *q++ = *r++; c--; /* minimum count is three, */
- *q++ = *r++; c--; /* so unroll loop a little */
- }
- else /* else offset after destination */
+ r = q - d;
+ if (r < s->window) /* wrap if needed */
{
- e = d - (uInt)(q - s->window); /* bytes from offset to end */
- r = s->end - e; /* pointer to offset */
- if (c > e) /* if source crosses, */
+ do {
+ r += s->end - s->window; /* force pointer in window */
+ } while (r < s->window); /* covers invalid distances */
+ e = s->end - r;
+ if (c > e)
{
- c -= e; /* copy to end of window */
+ c -= e; /* wrapped copy */
do {
- *q++ = *r++;
+ *q++ = *r++;
} while (--e);
- r = s->window; /* copy rest from start of window */
+ r = s->window;
+ do {
+ *q++ = *r++;
+ } while (--c);
}
+ else /* normal copy */
+ {
+ *q++ = *r++; c--;
+ *q++ = *r++; c--;
+ do {
+ *q++ = *r++;
+ } while (--c);
+ }
+ }
+ else /* normal copy */
+ {
+ *q++ = *r++; c--;
+ *q++ = *r++; c--;
+ do {
+ *q++ = *r++;
+ } while (--c);
}
- do { /* copy all or what's left */
- *q++ = *r++;
- } while (--c);
break;
}
else if ((e & 64) == 0)
diff --git a/sys/lib/libz/inffast.h b/sys/lib/libz/inffast.h
index 8facec55314..eaaa7840f17 100644
--- a/sys/lib/libz/inffast.h
+++ b/sys/lib/libz/inffast.h
@@ -1,5 +1,6 @@
+/* $OpenBSD: inffast.h,v 1.5 2002/03/12 00:26:30 millert Exp $ */
/* inffast.h -- header to use inffast.c
- * Copyright (C) 1995-1998 Mark Adler
+ * Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
diff --git a/sys/lib/libz/inffixed.h b/sys/lib/libz/inffixed.h
index 77f7e763145..acb4321a80e 100644
--- a/sys/lib/libz/inffixed.h
+++ b/sys/lib/libz/inffixed.h
@@ -1,3 +1,4 @@
+/* $OpenBSD: inffixed.h,v 1.2 2002/03/12 00:26:30 millert Exp $ */
/* inffixed.h -- table for decoding fixed codes
* Generated automatically by the maketree.c program
*/
diff --git a/sys/lib/libz/inflate.c b/sys/lib/libz/inflate.c
index cb1804452fd..6480283114e 100644
--- a/sys/lib/libz/inflate.c
+++ b/sys/lib/libz/inflate.c
@@ -1,5 +1,6 @@
+/* $OpenBSD: inflate.c,v 1.6 2002/03/12 00:26:30 millert Exp $ */
/* inflate.c -- zlib interface to inflate modules
- * Copyright (C) 1995-1998 Mark Adler
+ * Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
diff --git a/sys/lib/libz/inftrees.c b/sys/lib/libz/inftrees.c
index ef1e0b6b873..3c40bc26b9a 100644
--- a/sys/lib/libz/inftrees.c
+++ b/sys/lib/libz/inftrees.c
@@ -1,5 +1,6 @@
+/* $OpenBSD: inftrees.c,v 1.9 2002/03/12 00:26:30 millert Exp $ */
/* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-1998 Mark Adler
+ * Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -11,7 +12,7 @@
#endif
const char inflate_copyright[] =
- " inflate 1.1.3 Copyright 1995-1998 Mark Adler ";
+ " inflate 1.1.4 Copyright 1995-2002 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -104,8 +105,7 @@ uIntf *v; /* working area: values in order of bit length */
/* Given a list of code lengths and a maximum table size, make a set of
tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
if the given code set is incomplete (the tables are still built in this
- case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of
- lengths), or Z_MEM_ERROR if not enough memory. */
+ case), or Z_DATA_ERROR if the input is invalid. */
{
uInt a; /* counter for codes of length k */
@@ -231,7 +231,7 @@ uIntf *v; /* working area: values in order of bit length */
/* allocate new table */
if (*hn + z > MANY) /* (note: doesn't matter for fixed) */
- return Z_MEM_ERROR; /* not enough memory */
+ return Z_DATA_ERROR; /* overflow of MANY */
u[h] = q = hp + *hn;
*hn += z;
diff --git a/sys/lib/libz/inftrees.h b/sys/lib/libz/inftrees.h
index 85853e097b3..b24e9df531d 100644
--- a/sys/lib/libz/inftrees.h
+++ b/sys/lib/libz/inftrees.h
@@ -1,5 +1,6 @@
+/* $OpenBSD: inftrees.h,v 1.6 2002/03/12 00:26:30 millert Exp $ */
/* inftrees.h -- header to use inftrees.c
- * Copyright (C) 1995-1998 Mark Adler
+ * Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
diff --git a/sys/lib/libz/infutil.c b/sys/lib/libz/infutil.c
index 824dab57128..e1b00a1c66a 100644
--- a/sys/lib/libz/infutil.c
+++ b/sys/lib/libz/infutil.c
@@ -1,5 +1,6 @@
+/* $OpenBSD: infutil.c,v 1.6 2002/03/12 00:26:30 millert Exp $ */
/* inflate_util.c -- data and routines common to blocks and codes
- * Copyright (C) 1995-1998 Mark Adler
+ * Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
diff --git a/sys/lib/libz/infutil.h b/sys/lib/libz/infutil.h
index 99d1135d06a..cc871eb85e0 100644
--- a/sys/lib/libz/infutil.h
+++ b/sys/lib/libz/infutil.h
@@ -1,5 +1,6 @@
+/* $OpenBSD: infutil.h,v 1.6 2002/03/12 00:26:30 millert Exp $ */
/* infutil.h -- types and macros common to blocks and codes
- * Copyright (C) 1995-1998 Mark Adler
+ * Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
diff --git a/sys/lib/libz/zconf.h b/sys/lib/libz/zconf.h
index f842c008bd1..28be53ede63 100644
--- a/sys/lib/libz/zconf.h
+++ b/sys/lib/libz/zconf.h
@@ -1,6 +1,6 @@
-/* $OpenBSD: zconf.h,v 1.5 2000/03/03 00:54:57 todd Exp $ */
+/* $OpenBSD: zconf.h,v 1.6 2002/03/12 00:26:30 millert Exp $ */
/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * Copyright (C) 1995-2002 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
diff --git a/sys/lib/libz/zlib.h b/sys/lib/libz/zlib.h
index 9e231f491e9..db79ba24087 100644
--- a/sys/lib/libz/zlib.h
+++ b/sys/lib/libz/zlib.h
@@ -1,7 +1,8 @@
+/* $OpenBSD: zlib.h,v 1.6 2002/03/12 00:26:30 millert Exp $ */
/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.1.3, July 9th, 1998
+ version 1.1.4, March 11th, 2002
- Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
+ Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -37,7 +38,7 @@
extern "C" {
#endif
-#define ZLIB_VERSION "1.1.3"
+#define ZLIB_VERSION "1.1.4"
/*
The 'zlib' compression library provides in-memory compression and
diff --git a/sys/lib/libz/zutil.h b/sys/lib/libz/zutil.h
index 81789f67059..1b2304d3183 100644
--- a/sys/lib/libz/zutil.h
+++ b/sys/lib/libz/zutil.h
@@ -1,6 +1,6 @@
-/* $OpenBSD: zutil.h,v 1.11 2000/11/08 15:39:10 art Exp $ */
+/* $OpenBSD: zutil.h,v 1.12 2002/03/12 00:26:30 millert Exp $ */
/* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * Copyright (C) 1995-2002 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/