From 300776f39165da068757864e9cb3029f06f3be5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Wed, 22 Dec 2021 12:16:34 +0100 Subject: [PATCH] cpp: Check fpr of import status for NULL * lang/cpp/src/importresult.cpp (GpgME::ImportResult::Private): Check fpr for NULL. -- GnuPG-bug-id: 5713 --- lang/cpp/src/importresult.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lang/cpp/src/importresult.cpp b/lang/cpp/src/importresult.cpp index 20a3174b..803c34db 100644 --- a/lang/cpp/src/importresult.cpp +++ b/lang/cpp/src/importresult.cpp @@ -48,7 +48,9 @@ public: // We just need to handle the pointers in the structs: for (gpgme_import_status_t is = r.imports ; is ; is = is->next) { gpgme_import_status_t copy = new _gpgme_import_status(*is); - copy->fpr = strdup(is->fpr); + if (is->fpr) { + copy->fpr = strdup(is->fpr); + } copy->next = nullptr; imports.push_back(copy); }