mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Fix NULL de-ref for ambiguous key check in --export-ssh-keys.
* g10/getkey.c: Allow arg RET_KEYBLOCK to be NULL. -- This change adds the expected behavior for the getkey_next function to fix this NULL de-ref. GnuPG-bug-id: 2212 Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
eb9c021631
commit
b280aa6423
2 changed files with 10 additions and 1 deletions
|
@ -3059,6 +3059,9 @@ lookup (getkey_ctx_t ctx, kbnode_t *ret_keyblock, kbnode_t *ret_found_key,
|
|||
KBNODE keyblock = NULL;
|
||||
KBNODE found_key = NULL;
|
||||
|
||||
if (ret_keyblock)
|
||||
*ret_keyblock = NULL;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
rc = keydb_search (ctx->kr_handle, ctx->items, ctx->nitems, NULL);
|
||||
|
@ -3113,7 +3116,8 @@ found:
|
|||
|
||||
if (!rc)
|
||||
{
|
||||
*ret_keyblock = keyblock; /* Return the keyblock. */
|
||||
if (ret_keyblock)
|
||||
*ret_keyblock = keyblock; /* Return the keyblock. */
|
||||
keyblock = NULL;
|
||||
}
|
||||
else if (gpg_err_code (rc) == GPG_ERR_NOT_FOUND && no_suitable_key)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue