Commit 02a15e71 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

archive/zip: fix bug reading zip64 files

ZIP64 Extra records are variably sized, but we weren't capping
our reading of the extra fields at its previously-declared
size.

No test because I don't know how to easily create such files
and don't feel like manually construction one.  But all
existing tests pass, and this is "obviously correct" (queue
laughter).

Fixes #7069

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/48150043
parent 991e9a83
......@@ -253,7 +253,7 @@ func readDirectoryHeader(f *File, r io.Reader) error {
}
if tag == zip64ExtraId {
// update directory values from the zip64 extra block
eb := readBuf(b)
eb := readBuf(b[:size])
if len(eb) >= 8 {
f.UncompressedSize64 = eb.uint64()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment