From a6e5c8bf18696007c48c6f362aa355020fe82f21 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Tue, 24 Jul 2018 08:40:28 +0200 Subject: cpp: Add safety checks for key update * lang/cpp/src/key.cpp (Key::update): Check that the key is not NULL. * lang/cpp/src/verificationresult.cpp (GpgME::Signature::key): Check for fingerprint. --- lang/cpp/src/key.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lang/cpp/src/key.cpp') diff --git a/lang/cpp/src/key.cpp b/lang/cpp/src/key.cpp index 61b3eb77..8fc266ff 100644 --- a/lang/cpp/src/key.cpp +++ b/lang/cpp/src/key.cpp @@ -347,6 +347,9 @@ const Key &Key::mergeWith(const Key &other) void Key::update() { + if (isNull() || !primaryFingerprint()) { + return; + } auto ctx = Context::createForProtocol(protocol()); if (!ctx) { return; -- cgit v1.2.3