diff options
author | obrien <obrien@FreeBSD.org> | 2004-05-02 23:07:49 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2004-05-02 23:07:49 +0000 |
commit | 9936ba40b63281e2b2b25c30cdac5c15f4fe2628 (patch) | |
tree | c6e7dc243b280cc28d9553fd1b7169ec572626fc /gnu/usr.bin/gzip | |
parent | 490330a22a0ac71ef7b66bacf4b1c7386f2a272f (diff) | |
download | FreeBSD-src-9936ba40b63281e2b2b25c30cdac5c15f4fe2628.zip FreeBSD-src-9936ba40b63281e2b2b25c30cdac5c15f4fe2628.tar.gz |
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
Diffstat (limited to 'gnu/usr.bin/gzip')
-rw-r--r-- | gnu/usr.bin/gzip/gzip.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gnu/usr.bin/gzip/gzip.h b/gnu/usr.bin/gzip/gzip.h index 1ec96cb..79b0efd 100644 --- a/gnu/usr.bin/gzip/gzip.h +++ b/gnu/usr.bin/gzip/gzip.h @@ -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 |