From c232411e9674c3fbf2c9196cbad4d2159ef7af10 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 26 Aug 2014 12:30:00 +0200 Subject: [PATCH] uploading: make sure to cast to uint64 to avoid integer overflow --- src/mirall/propagator_qnam.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mirall/propagator_qnam.cpp b/src/mirall/propagator_qnam.cpp index 61404a875..f3b3bf44b 100644 --- a/src/mirall/propagator_qnam.cpp +++ b/src/mirall/propagator_qnam.cpp @@ -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; }