[Pkg-gnupg-commit] [gnupg2] 171/185: gpg: Fix segv in get_best_pubkey_byname.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Mon Aug 7 11:55:33 UTC 2017


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch experimental
in repository gnupg2.

commit 6496dc1f9d2aef3bf8cf950da2434c96f7a0145c
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Jul 28 10:58:59 2017 +0200

    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 at gnupg.org>
---
 g10/getkey.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/g10/getkey.c b/g10/getkey.c
index 390e2dc..e0c4bd9 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -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)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list