summaryrefslogtreecommitdiff
path: root/lib/rpmchecksig.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-03-25 17:00:41 +0200
committerPanu Matilainen <pmatilai@redhat.com>2009-03-25 17:00:41 +0200
commit5f445d7e8f14df6976b9fa19e9caf4a0dfbcbebb (patch)
treea5e696fa87dab206239e45830ff5d6f7eaabd711 /lib/rpmchecksig.c
parent678dceb2455537895e6562886d7887614d546e61 (diff)
downloadrpm-5f445d7e8f14df6976b9fa19e9caf4a0dfbcbebb.tar.gz
rpm-5f445d7e8f14df6976b9fa19e9caf4a0dfbcbebb.tar.bz2
rpm-5f445d7e8f14df6976b9fa19e9caf4a0dfbcbebb.zip
Make sure fd bundle is always NULLed on rpmVerifySignatures() exit
- readFile() failure could crash on double-free otherwise
Diffstat (limited to 'lib/rpmchecksig.c')
-rw-r--r--lib/rpmchecksig.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c
index 9680c5dd6..956afdd11 100644
--- a/lib/rpmchecksig.c
+++ b/lib/rpmchecksig.c
@@ -697,7 +697,6 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd,
if (readFile(fd, fn, dig, plbundle, hdrbundle)) {
goto exit;
}
- fdSetBundle(fd, NULL); /* XXX avoid double-free from fd close */
rasprintf(&buf, "%s:%c", fn, (rpmIsVerbose() ? '\n' : ' ') );
@@ -776,6 +775,7 @@ exit:
free(buf);
rpmDigestBundleFree(hdrbundle);
rpmDigestBundleFree(plbundle);
+ fdSetBundle(fd, NULL); /* XXX avoid double-free from fd close */
sigh = rpmFreeSignature(sigh);
hi = headerFreeIterator(hi);
rpmKeyringFree(keyring);