diff --git a/src/utility/streamUtils.cpp b/src/utility/streamUtils.cpp
index 72916547..06ea17a1 100644
--- a/src/utility/streamUtils.cpp
+++ b/src/utility/streamUtils.cpp
@@ -68,7 +68,7 @@ stream::size_type bufferedStreamCopyRange(inputStream& is, outputStream& os,
 	while (!is.eof() && total < length)
 	{
 		const stream::size_type remaining = std::min(length - total, blockSize);
-		const stream::size_type read = is.read(buffer, blockSize);
+		const stream::size_type read = is.read(buffer, remaining);
 
 		if (read != 0)
 		{