summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-12-16 22:38:41 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-12-16 22:38:41 +0000
commit1cc43490681263089ee601bd6579ea970c6b5065 (patch)
treee2352d990a538c7fdc1138748dfaf086a268ee0e
parent9d357bb40990d1fef0b92e9bd97c9569bac9282f (diff)
when we read the original file size from the gzp header in uncompress mode
and compare it to total_out to detect I/O errors we need to cast total_out to u_int32_t as the gzip header file is limited to that and total_out is now 64 bits. ok millert@
-rw-r--r--usr.bin/compress/gzopen.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/compress/gzopen.c b/usr.bin/compress/gzopen.c
index 42f18bb2a23..dda9addff80 100644
--- a/usr.bin/compress/gzopen.c
+++ b/usr.bin/compress/gzopen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gzopen.c,v 1.17 2003/12/09 07:34:55 millert Exp $ */
+/* $OpenBSD: gzopen.c,v 1.18 2003/12/16 22:38:40 henning Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -59,7 +59,7 @@
*/
const char gz_rcsid[] =
- "$OpenBSD: gzopen.c,v 1.17 2003/12/09 07:34:55 millert Exp $";
+ "$OpenBSD: gzopen.c,v 1.18 2003/12/16 22:38:40 henning Exp $";
#include <sys/param.h>
#include <sys/stat.h>
@@ -434,7 +434,7 @@ gz_read(void *cookie, char *buf, int len)
errno = EINVAL;
return -1;
}
- if (get_int32(s) != s->z_stream.total_out) {
+ if (get_int32(s) != (u_int32_t)s->z_stream.total_out) {
errno = EIO;
return -1;
}