]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/acquire.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 9 Aug 2011 12:52:13 +0000 (14:52 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 9 Aug 2011 12:52:13 +0000 (14:52 +0200)
  - fix potential divide-by-zero

apt-pkg/acquire.cc
debian/changelog

index 2064abc5031d8005b8af2dcae02819c5f4171f51..06b0f11f8179c541eda2fd512bfac89c199d9c90 100644 (file)
@@ -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 */ )
index 8ea1ee32e5d827dab64ad012fb336c3a7b0cb244..59434546b7ffd731f32c5abd3fb4d5c240101b16 100644 (file)
@@ -1,3 +1,10 @@
+apt (0.8.16~exp5ubuntu3) UNRELEASEDoneiric; urgency=low
+
+  * apt-pkg/acquire.cc:
+    - fix potential divide-by-zero
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Tue, 09 Aug 2011 14:51:07 +0200
+
 apt (0.8.16~exp5ubuntu2) oneiric; urgency=low
 
   * test/integration/test-hashsum-verification: