summaryrefslogtreecommitdiff
path: root/google/zip_reader.h
diff options
context:
space:
mode:
authorjoaoe@opera.com <joaoe@opera.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-07 20:53:02 +0000
committerjoaoe@opera.com <joaoe@opera.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-07 20:53:02 +0000
commit7e84479ea07c6fd65d77412bcbf735751f42e230 (patch)
tree14a6f8593e9555cec82b0ca5826d7edd5e3d4741 /google/zip_reader.h
parent16b1df3048304a451bc76257da8a7f510f5b9be7 (diff)
downloadzlib-7e84479ea07c6fd65d77412bcbf735751f42e230.tar.gz
Fixed uncompressing files with wrong uncompressed size set.
A zip file carries some metadata for each archived file, including the total uncompressed size. If that size was incorrect, therefore the compressed file being different in size when unpacking, the minizip code would fail with a CRC error. Every other zip utility handles these files, so should the minizip code for safety sake. BUG=359516 Review URL: https://codereview.chromium.org/222243003 Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 764f0715d75c8d49339aa73d0ee2feb75d63473f
Diffstat (limited to 'google/zip_reader.h')
-rw-r--r--google/zip_reader.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/google/zip_reader.h b/google/zip_reader.h
index e16a2fb..60b53ee 100644
--- a/google/zip_reader.h
+++ b/google/zip_reader.h
@@ -64,6 +64,8 @@ class ZipReader {
// Returns the size of the original file (i.e. after uncompressed).
// Returns 0 if the entry is a directory.
+ // Note: this value should not be trusted, because it is stored as metadata
+ // in the zip archive and can be different from the real uncompressed size.
int64 original_size() const { return original_size_; }
// Returns the last modified time. If the time stored in the zip file was