diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2020-09-01 15:40:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-01 15:40:46 +0200 |
commit | 2b192e7061c9f0324f209bdb3de6f5f9bf2b1dcd (patch) | |
tree | 7b4bfc88f915e5667c8ac0ba6975a91748044e43 | |
parent | f32c84a29f17b64d40c81592cd2633eabcc83efc (diff) | |
parent | ab6bd79c02bd2de091c2fb9585f42e97d1e222df (diff) | |
download | nextcloud-server-2b192e7061c9f0324f209bdb3de6f5f9bf2b1dcd.tar.gz nextcloud-server-2b192e7061c9f0324f209bdb3de6f5f9bf2b1dcd.zip |
Merge pull request #22535 from nextcloud/fix/zipstreamer_external_storage
Only disable zip64 if the size is known
-rw-r--r-- | lib/private/Streamer.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Streamer.php b/lib/private/Streamer.php index a05f77f3cbd..0e3018f77b7 100644 --- a/lib/private/Streamer.php +++ b/lib/private/Streamer.php @@ -76,8 +76,12 @@ class Streamer { * would still be possible to create an invalid zip32 file (for example, * a zip file from files smaller than 4GB with a central directory * larger than 4GiB), but it should not happen in the real world. + * + * We also have to check for a size above 0. As negative sizes could be + * from not fully scanned external storages. And then things fall apart + * if somebody tries to package to much. */ - if ($size < 4 * 1000 * 1000 * 1000 && $numberOfFiles < 65536) { + if ($size > 0 && $size < 4 * 1000 * 1000 * 1000 && $numberOfFiles < 65536) { $this->streamerInstance = new ZipStreamer(['zip64' => false]); } elseif ($request->isUserAgent($this->preferTarFor)) { $this->streamerInstance = new TarStreamer(); |