summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-05-15 07:53:22 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2015-05-15 07:53:22 +0200
commit0d701b77592a7364529b300cbaad938326be1710 (patch)
treef1e78a346c4c0c1367332696011cd73464d1f6cf
parent20b8f1e777d04ce7daa771ee75092192d3120bda (diff)
downloadplan9front-0d701b77592a7364529b300cbaad938326be1710.tar.xz
gunzip: the extra length field (XLEN) is two bytes instead of one
example file: https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R50f.tgz
-rw-r--r--sys/src/cmd/gzip/gunzip.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/src/cmd/gzip/gunzip.c b/sys/src/cmd/gzip/gunzip.c
index 2ce099633..0b0c8165e 100644
--- a/sys/src/cmd/gzip/gunzip.c
+++ b/sys/src/cmd/gzip/gunzip.c
@@ -236,9 +236,12 @@ header(Biobuf *bin, GZHead *h)
/* OS type */
get1(bin);
- if(flag & GZFEXTRA)
- for(i=get1(bin); i>0; i--)
+ if(flag & GZFEXTRA){
+ i = get1(bin);
+ i |= get1(bin)<<8;
+ for(; i>0; i--)
get1(bin);
+ }
/* name */
if(flag & GZFNAME){