summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-08-09 14:50:20 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-08-09 14:50:20 +0200
commitc033d41504957ed04d64ec72e7f47dfac64218b5 (patch)
treec2b142f7bfc615bae41b708ece370873e2523d81
parent216d0bd8869c4f52ead5256064512ac97e9fc824 (diff)
* apt-pkg/acquire.cc:
- fix potential divide-by-zero
-rw-r--r--apt-pkg/acquire.cc4
-rw-r--r--debian/changelog2
2 files changed, 5 insertions, 1 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 2064abc50..06b0f11f8 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -849,7 +849,9 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner)
char msg[200];
long i = CurrentItems < TotalItems ? CurrentItems + 1 : CurrentItems;
- unsigned long long const ETA = (TotalBytes - CurrentBytes) / CurrentCPS;
+ unsigned long long ETA = 0;
+ if(CurrentCPS > 0)
+ ETA = (TotalBytes - CurrentBytes) / CurrentCPS;
// only show the ETA if it makes sense
if (ETA > 0 && ETA < 172800 /* two days */ )
diff --git a/debian/changelog b/debian/changelog
index 8719776e0..db80c14ef 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,8 @@ apt (0.8.16~exp5) experimental; urgency=low
* apt-pkg/acquire-item.{cc,h}:
- do not check for a "Package" tag in optional index targets
like the translations index
+ * apt-pkg/acquire.cc:
+ - fix potential divide-by-zero
-- Michael Vogt <mvo@debian.org> Fri, 05 Aug 2011 10:57:08 +0200