From fc23c70a1f349ff4c54fca18c17437cacf6c26dc Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Fri, 4 Jul 2014 16:47:11 +0200 Subject: [PATCH] Fix CID 1116481 Widening should happen before calculation --- .../apache/cloudstack/storage/template/DownloadManagerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java b/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java index d45a6bbe607..ec5b56969c1 100755 --- a/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java +++ b/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java @@ -357,7 +357,7 @@ public class DownloadManagerImpl extends ManagerBase implements DownloadManager int imgSizeGigs = (int)Math.ceil(_storage.getSize(td.getDownloadLocalPath()) * 1.0d / (1024 * 1024 * 1024)); imgSizeGigs++; // add one just in case - long timeout = imgSizeGigs * installTimeoutPerGig; + long timeout = (long)imgSizeGigs * installTimeoutPerGig; Script scr = null; String script = resourceType == ResourceType.TEMPLATE ? createTmpltScr : createVolScr; scr = new Script(script, timeout, s_logger);