diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-03-25 17:00:41 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-03-25 17:00:41 +0200 |
commit | 5f445d7e8f14df6976b9fa19e9caf4a0dfbcbebb (patch) | |
tree | a5e696fa87dab206239e45830ff5d6f7eaabd711 /lib/rpmchecksig.c | |
parent | 678dceb2455537895e6562886d7887614d546e61 (diff) | |
download | rpm-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.c | 2 |
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); |