uploading: make sure to cast to uint64 to avoid integer overflow

This commit is contained in:
Olivier Goffart 2014-08-26 12:30:00 +02:00 committed by Markus Goetz
parent 7ec0c52439
commit c232411e96

View file

@ -28,7 +28,7 @@
namespace Mirall {
static uint chunkSize() {
static qint64 chunkSize() {
static uint chunkSize;
if (!chunkSize) {
chunkSize = qgetenv("OWNCLOUD_CHUNK_SIZE").toUInt();
@ -298,7 +298,7 @@ void PropagateUploadFileQNAM::startNextChunk()
currentChunkSize = chunkSize();
}
}
device = new ChunkDevice(_file, chunkSize() * sendingChunk, currentChunkSize);
device = new ChunkDevice(_file, chunkSize() * quint64(sendingChunk), currentChunkSize);
} else {
device = _file;
}