Merge pull request #8752 from nextcloud/13-8112
[stable13] Fix integer overflow in ChunkingPlugin
This commit is contained in:
commit
0f1567d8fa
|
@ -99,7 +99,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");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue