diff options
| author | Roland Shoemaker <roland@golang.org> | 2022-12-01 09:02:16 -0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2022-12-01 17:46:25 +0000 |
| commit | 791f7580758d9e4ea2c393dbe91b5f89fa16da18 (patch) | |
| tree | 86253ca4cc4196b69035be4a026fa6c905f85008 /src/internal | |
| parent | 34ab0bcc5eaf97cc0aff11cfe782e4c174d52ef0 (diff) | |
| download | go-791f7580758d9e4ea2c393dbe91b5f89fa16da18.tar.xz | |
archive/zip: tolerate compressed directories with zero uncompressed size
In CL 449955 we made reading of directories with associated file data
an error, since it is a "must not" in the zip specification. It turns
out that a number of implementations make the mistake of not setting
the correct compression method on directories (in particular the Java
jar tool does this when storing the META-INF directory). If the
compression method used is not 0 (stored) then the compressed size of
the directory can be > 0, despite the uncompressed size still being 0.
Since this mistake is not uncommon, we are forced to tolerate it. We
still fail if the recorded uncompressed size is > 0, which should be
a significantly harder mistake to make.
Change-Id: Ia732b10787f26ab937ac9cf9869ac3042efb8118
Reviewed-on: https://go-review.googlesource.com/c/go/+/454475
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Diffstat (limited to 'src/internal')
0 files changed, 0 insertions, 0 deletions
