summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-02-26 12:40:06 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2009-02-26 12:40:06 +0100
commitea270854ebb60cdbf3ada8137e5b5653d2a4ad05 (patch)
treebdd303312643f86177df5aa3bad431d0099c28fc /lib
parent2b02070dbe34f79c644b4330cec3dde530985b07 (diff)
parent6276ccfba9ea29d2fc78293968246af9c2e2c800 (diff)
downloadabrt-ea270854ebb60cdbf3ada8137e5b5653d2a4ad05.tar.gz
abrt-ea270854ebb60cdbf3ada8137e5b5653d2a4ad05.tar.xz
abrt-ea270854ebb60cdbf3ada8137e5b5653d2a4ad05.zip
Merge branch 'master' of git://git.fedorahosted.org/git/crash-catcher
Diffstat (limited to 'lib')
-rw-r--r--lib/MiddleWare/RPMInfo.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/MiddleWare/RPMInfo.cpp b/lib/MiddleWare/RPMInfo.cpp
index 605f698..64f0628 100644
--- a/lib/MiddleWare/RPMInfo.cpp
+++ b/lib/MiddleWare/RPMInfo.cpp
@@ -17,7 +17,12 @@ void CRPMInfo::LoadOpenGPGPublicKey(const std::string& pFileName)
uint8_t* pkt = NULL;
size_t pklen;
pgpKeyID_t keyID;
- pgpReadPkts(pFileName.c_str(), &pkt, &pklen);
+ if (pgpReadPkts(pFileName.c_str(), &pkt, &pklen) != PGPARMOR_PUBKEY)
+ {
+ free(pkt);
+ std::cerr << "CRPMInfo::LoadOpenGPGPublicKey(): Can not load publick key " + pFileName << std::endl;
+ return;
+ }
if (pgpPubkeyFingerprint(pkt, pklen, keyID) == 0)
{
char* fedoraFingerprint = pgpHexStr(keyID, sizeof(keyID));
@@ -26,10 +31,7 @@ void CRPMInfo::LoadOpenGPGPublicKey(const std::string& pFileName)
m_setFingerprints.insert(fedoraFingerprint);
}
}
- if (pkt)
- {
- free(pkt);
- }
+ free(pkt);
}
bool CRPMInfo::CheckFingerprint(const std::string& pPackage)