rpm/rpm-4.9.0-beta1-rpmdb-dsi.p...

23 lines
842 B
Diff

commit bd96c179b79fce627403804ad6c236c783aca478
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Fri Jan 21 14:02:28 2011 +0200
Plug potential division by zero in the rpmdb size calculation (RhBug:671056)
- This smells like treating the symptom instead of the disease, add
a reminder comment to figure out what's going on here...
diff --git a/lib/transaction.c b/lib/transaction.c
index ed6f738..06e54af 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -246,7 +246,8 @@ static void rpmtsUpdateDSIrpmDBSize(const rpmte p,
rpm_loff_t headerSize;
int64_t bneeded;
- if (dsi==NULL) return;
+ /* XXX somehow we can end up here with bsize 0 (RhBug:671056) */
+ if (dsi == NULL || dsi->bsize == 0) return;
headerSize = rpmteHeaderSize(p);
bneeded = BLOCK_ROUND(headerSize, dsi->bsize);