From bcce55b873ab1b57038df5109e13b5058cc63ad7 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Sun, 7 Jul 2019 10:58:39 +0100 Subject: [PATCH] fix integer overflow --- .../main/groovy/com/muwire/core/download/DownloadSession.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/groovy/com/muwire/core/download/DownloadSession.groovy b/core/src/main/groovy/com/muwire/core/download/DownloadSession.groovy index 2fd5c1ee..99adaa85 100644 --- a/core/src/main/groovy/com/muwire/core/download/DownloadSession.groovy +++ b/core/src/main/groovy/com/muwire/core/download/DownloadSession.groovy @@ -84,7 +84,7 @@ class DownloadSession { log.info("will download piece $piece from position $position steal $steal") - long pieceStart = piece * pieceSize + long pieceStart = piece * ((long)pieceSize) long end = Math.min(fileLength, pieceStart + pieceSize) - 1 long start = pieceStart + position String root = Base64.encode(infoHash.getRoot())