summaryrefslogtreecommitdiffstats
path: root/crypt-gpgme.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2022-11-01 20:22:06 -0700
committerKevin McCarthy <kevin@8t8.us>2022-11-03 09:47:07 -0700
commitb254f2fb44f994c48e2491adaf03d97d3c628283 (patch)
treeac37e2dd1814298767d8fa0e6807e05b9f17888b /crypt-gpgme.c
parentf0eb3586480c301b66657c7326b6546ef086c7f4 (diff)
Add a check for key->uids in create_recipient_set.
For gpgme < 1.11.0, it used this function to create the encryption key list. The '!' was interpreted differently back then, and it apparently didn't check if the returned key had any uids before referencing it. Add a check to prevent a segv as in the public key block fix.
Diffstat (limited to 'crypt-gpgme.c')
-rw-r--r--crypt-gpgme.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypt-gpgme.c b/crypt-gpgme.c
index bf120ab5..fdf44af4 100644
--- a/crypt-gpgme.c
+++ b/crypt-gpgme.c
@@ -915,7 +915,7 @@ static gpgme_key_t *create_recipient_set (const char *keylist, int use_smime)
buf[i-1] = 0;
err = gpgme_get_key (context, buf, &key, 0);
- if (! err)
+ if (! err && key->uids)
key->uids->validity = GPGME_VALIDITY_FULL;
buf[i-1] = '!';
}