diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-03-09 10:27:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-09 10:27:17 +0100 |
commit | ed5008597f43a28114b04dfe4706cf5d6a6b5e57 (patch) | |
tree | 927a19b09141abe06783e9e0ec02576fccfc5b0e /apps/dav | |
parent | 528ffaf2505dabd49e3b9c8ed48fdbd5a23f3ee5 (diff) | |
parent | fc4e0501f03de66eafb0a3a2d04024a40be17756 (diff) | |
download | nextcloud-server-ed5008597f43a28114b04dfe4706cf5d6a6b5e57.tar.gz nextcloud-server-ed5008597f43a28114b04dfe4706cf5d6a6b5e57.zip |
Merge pull request #8112 from nextcloud/fix-integer-overflow
Fix integer overflow in ChunkingPlugin
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/lib/Upload/ChunkingPlugin.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/dav/lib/Upload/ChunkingPlugin.php b/apps/dav/lib/Upload/ChunkingPlugin.php index a3f6e528c6b..421a2dd519a 100644 --- a/apps/dav/lib/Upload/ChunkingPlugin.php +++ b/apps/dav/lib/Upload/ChunkingPlugin.php @@ -97,7 +97,10 @@ class ChunkingPlugin extends ServerPlugin { return; } $actualSize = $this->sourceNode->getSize(); - if ((int)$expectedSize !== $actualSize) { + + // casted to string because cast to float cause equality for non equal numbers + // and integer has the problem of limited size on 32 bit systems + if ((string)$expectedSize !== (string)$actualSize) { throw new BadRequest("Chunks on server do not sum up to $expectedSize but to $actualSize bytes"); } } |