From 5fb879d20a048217c578c981233a7cbb702cf60a Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Wed, 12 Jul 2017 09:47:45 +0200 Subject: [PATCH] Fix use of uninitialized value in sgpgme_has_secret_key(). Fixes commit 11980bc7a. --- src/plugins/pgpcore/sgpgme.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/pgpcore/sgpgme.c b/src/plugins/pgpcore/sgpgme.c index 0579f4205..4ae51b377 100644 --- a/src/plugins/pgpcore/sgpgme.c +++ b/src/plugins/pgpcore/sgpgme.c @@ -1098,9 +1098,10 @@ gboolean sgpgme_has_secret_key(void) } check_again: err = gpgme_op_keylist_start(ctx, NULL, TRUE); - if (!err) + if (!err) { err = gpgme_op_keylist_next(ctx, &key); - gpgme_key_unref(key); /* We're not interested in the key itself. */ + gpgme_key_unref(key); /* We're not interested in the key itself. */ + } gpgme_op_keylist_end(ctx); if (gpg_err_code(err) == GPG_ERR_EOF) { if (gpgme_get_protocol(ctx) != GPGME_PROTOCOL_CMS) { -- 2.25.1