Gzip assumes 'unsigned long' is 32-bits wide and depends on this.

One thing Gzip does is implicitly by store the size of a file into an
'unsigned long' rather than  explicitly compute the remainder modulo 2^32
(see RFC 1952 section 2.3.1 "ISIZE").  Thus an extracted file size is
does not equal the original size (mod 2^32) for files larger than 4GB.

This manifests itself in errors such as:
	zcat: bigfile.gz: invalid compressed data--length error

PR:		66008, 66009
Submitted by:	Peter Losher <Peter_Losher@isc.org>
Patch by:	tjr
This commit is contained in:
David E. O'Brien 2004-05-02 23:07:49 +00:00
parent f1fe72c1cc
commit 774cd1faf6

View File

@ -2,6 +2,8 @@
* Copyright (C) 1992-1993 Jean-loup Gailly.
* This is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License, see the file COPYING.
*
* $FreeBSD$
*/
#if defined(__STDC__) || defined(PROTO)
@ -41,9 +43,10 @@
#define local static
typedef unsigned char uch;
typedef unsigned short ush;
typedef unsigned long ulg;
#include <stdint.h>
typedef uint8_t uch;
typedef uint16_t ush;
typedef uint32_t ulg;
/* Return codes from gzip */
#define OK 0