aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2020-09-01 15:40:46 +0200
committerGitHub <noreply@github.com>2020-09-01 15:40:46 +0200
commit2b192e7061c9f0324f209bdb3de6f5f9bf2b1dcd (patch)
tree7b4bfc88f915e5667c8ac0ba6975a91748044e43
parentf32c84a29f17b64d40c81592cd2633eabcc83efc (diff)
parentab6bd79c02bd2de091c2fb9585f42e97d1e222df (diff)
downloadnextcloud-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.php6
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();