aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@gmail.com>2016-11-10 16:19:41 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-11-10 17:52:59 +0100
commit8aceb9b6a318668d0795af52bf9ea9dbb33351d9 (patch)
treeb0d72b0cbfc1a315fe7b4995c85bc7055ae8a095
parentc0cd32a238d331e316090e04b33ea7f195a3dc59 (diff)
downloadperl-URPM-8aceb9b6a318668d0795af52bf9ea9dbb33351d9.tar
perl-URPM-8aceb9b6a318668d0795af52bf9ea9dbb33351d9.tar.gz
perl-URPM-8aceb9b6a318668d0795af52bf9ea9dbb33351d9.tar.bz2
perl-URPM-8aceb9b6a318668d0795af52bf9ea9dbb33351d9.tar.xz
perl-URPM-8aceb9b6a318668d0795af52bf9ea9dbb33351d9.zip
make sure to use int64 on 32bit arch
else we may got total size to overflow (mga#19686) v2 by Thierry Vignaud: use native int64 on 64bit
-rw-r--r--NEWS2
-rw-r--r--URPM/Resolve.pm2
2 files changed, 4 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 48ace9a..1098c81 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
- fix more compilation warnings
+- make sure to use int64 on 32bit arch
+ else we may got total size to overflow (mga#19686)
Version 5.11 - 20 October 2016
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 737ee1c..8020981 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -6,6 +6,7 @@ package URPM;
use strict;
use warnings;
use Config;
+use Math::Int64 ':native_if_available', 'int64';
# perl_checker: require URPM
@@ -1837,6 +1838,7 @@ sub _selected_size_filesize {
my ($urpm, $state, $compute_filesize) = @_;
my ($size, $filesize, $bad_filesize);
+ $size = int64(0); # make sure to use Int64, even on 32bit
foreach (keys %{$state->{selected} || {}}) {
my $pkg = $urpm->{depslist}[$_];
$size += $pkg->size;