go/src/archive/zip
Meng Zhuo b6fb3af6af archive/zip: fail fast if UncompressedSize64 < nread
The zip reader checks that the uncompressed file size is valid
after all compressed files read until EOF.
However in between reading each file, there could have already
been an overflow where nread > UncompressedSize64 hence this
change will now return ErrFormat in such situations.

Fixes #49791

Change-Id: If3584a57d173de6a97bf35c07d2a99ff6972f820
Reviewed-on: https://go-review.googlesource.com/c/go/+/366854
Trust: mzh <mzh@golangcn.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
2022-04-11 01:24:31 +00:00
..
testdata archive/zip: only return directory once via io/fs.FS 2021-04-29 19:04:31 +00:00
example_test.go
fuzz_test.go all: add a handful of fuzz targets 2022-01-13 18:06:33 +00:00
reader.go archive/zip: fail fast if UncompressedSize64 < nread 2022-04-11 01:24:31 +00:00
reader_test.go archive/zip: fail fast if UncompressedSize64 < nread 2022-04-11 01:24:31 +00:00
register.go all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
struct.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
writer.go archive/zip: add File.OpenRaw, Writer.CreateRaw, Writer.Copy 2021-05-03 21:11:47 +00:00
writer_test.go all: use bytes.Cut, strings.Cut 2021-10-06 15:53:04 +00:00
zip_test.go all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00