aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-11-28 12:36:56 +0000
committerJustus Winter <[email protected]>2016-11-28 12:48:19 +0000
commit4db9a425644dccaf81b51ebc97b32a9cc21941a4 (patch)
treefb5be0072f64b9b85811271428141829f711e8aa
parenttests: Rename ssh test. (diff)
downloadgnupg-4db9a425644dccaf81b51ebc97b32a9cc21941a4.tar.gz
gnupg-4db9a425644dccaf81b51ebc97b32a9cc21941a4.zip
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 <[email protected]>
-rw-r--r--g10/getkey.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index 68e6a1bf0..6eec087cf 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -2178,7 +2178,7 @@ getkey_next (getkey_ctx_t ctx, PKT_public_key *pk, kbnode_t *ret_keyblock)
if (pk && ret_keyblock == NULL)
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)
{
log_assert (found_key);