diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2011-01-21 14:02:28 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2011-01-21 14:02:28 +0200 |
commit | bd96c179b79fce627403804ad6c236c783aca478 (patch) | |
tree | b458c216f85368cecc9701619b51c692989fb48f /lib | |
parent | a3ec6066af23e0c9e0de6160c14cb2a502e8fa89 (diff) | |
download | librpm-tizen-bd96c179b79fce627403804ad6c236c783aca478.tar.gz librpm-tizen-bd96c179b79fce627403804ad6c236c783aca478.tar.bz2 librpm-tizen-bd96c179b79fce627403804ad6c236c783aca478.zip |
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...
Diffstat (limited to 'lib')
-rw-r--r-- | lib/transaction.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/transaction.c b/lib/transaction.c index ed6f73842..06e54af36 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); |