diff options
author | Andre Heinecke <[email protected]> | 2018-07-24 06:40:28 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2018-07-24 06:40:28 +0000 |
commit | a6e5c8bf18696007c48c6f362aa355020fe82f21 (patch) | |
tree | 1dbe85e013210d0ca0cb48374f4e0463bea86835 /lang/cpp/src/key.cpp | |
parent | docs: python bindings howto (diff) | |
download | gpgme-a6e5c8bf18696007c48c6f362aa355020fe82f21.tar.gz gpgme-a6e5c8bf18696007c48c6f362aa355020fe82f21.zip |
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.
Diffstat (limited to 'lang/cpp/src/key.cpp')
-rw-r--r-- | lang/cpp/src/key.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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; |