gpg: Fix segv importing certain keys.

* g10/key-check.c (key_check_all_keysigs): Initialize issuer.
--

Fixes-commit: 404fa8211b
from 2017

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2020-09-02 15:30:44 +02:00
parent 0a9665187a
commit 896c528ba0
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 5 additions and 2 deletions

View File

@ -367,8 +367,11 @@ key_check_all_keysigs (ctrl_t ctrl, int mode, kbnode_t kb,
if (only_selfsigs)
continue;
issuer = xmalloc (sizeof (*issuer));
err = get_pubkey (ctrl, issuer, sig->keyid);
issuer = xtrycalloc (1, sizeof *issuer);
if (!issuer)
err = gpg_error_from_syserror ();
else
err = get_pubkey (ctrl, issuer, sig->keyid);
if (err)
{
xfree (issuer);