mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-21 14:47:03 +01:00
gpg: Fix segv in get_best_pubkey_byname.
* g10/getkey.c (get_best_pubkey_byname): Init NEW. -- We call free_user_id on NEW.uid and thus it needs to be initialized. This fixes the ref-count or invisible segv bug from GnuPG-bug-id: 3266 Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
5516ef47a2
commit
6496dc1f9d
@ -1607,7 +1607,7 @@ get_best_pubkey_byname (ctrl_t ctrl, GETKEY_CTX *retctx, PKT_public_key *pk,
|
||||
{
|
||||
/* Rank results and return only the most relevant key. */
|
||||
struct pubkey_cmp_cookie best = { 0 };
|
||||
struct pubkey_cmp_cookie new;
|
||||
struct pubkey_cmp_cookie new = { 0 };
|
||||
kbnode_t new_keyblock;
|
||||
|
||||
while (getkey_next (ctrl, ctx, &new.key, &new_keyblock) == 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user