summaryrefslogtreecommitdiff
path: root/vendor/github.com/klauspost/compress/gzip/gunzip.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/klauspost/compress/gzip/gunzip.go')
-rw-r--r--vendor/github.com/klauspost/compress/gzip/gunzip.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/vendor/github.com/klauspost/compress/gzip/gunzip.go b/vendor/github.com/klauspost/compress/gzip/gunzip.go
index dc2362a63..00a0a2c38 100644
--- a/vendor/github.com/klauspost/compress/gzip/gunzip.go
+++ b/vendor/github.com/klauspost/compress/gzip/gunzip.go
@@ -238,6 +238,11 @@ func (z *Reader) readHeader() (hdr Header, err error) {
}
}
+ // Reserved FLG bits must be zero.
+ if flg>>5 != 0 {
+ return hdr, ErrHeader
+ }
+
z.digest = 0
if z.decompressor == nil {
z.decompressor = flate.NewReader(z.r)