mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-07 17:33:02 +01:00
g10: Fix iteration over getkey results.
* g10/getkey.c (getkey_next): Only ask 'lookup' for the exact match if our caller requested the key. Fixes a crash in 'lookup'. GnuPG-bug-id: 2848 Fixes-commit: 1d03cc77e1706f7da653153ad4b58c61e4fd2573 Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
cc1d213426
commit
4db9a42564
@ -2178,7 +2178,7 @@ getkey_next (getkey_ctx_t ctx, PKT_public_key *pk, kbnode_t *ret_keyblock)
|
|||||||
if (pk && ret_keyblock == NULL)
|
if (pk && ret_keyblock == NULL)
|
||||||
ret_keyblock = &keyblock;
|
ret_keyblock = &keyblock;
|
||||||
|
|
||||||
rc = lookup (ctx, ret_keyblock, &found_key, ctx->want_secret);
|
rc = lookup (ctx, ret_keyblock, pk ? &found_key : NULL, ctx->want_secret);
|
||||||
if (!rc && pk)
|
if (!rc && pk)
|
||||||
{
|
{
|
||||||
log_assert (found_key);
|
log_assert (found_key);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user