[Pkg-gnupg-commit] [gnupg2] 156/241: gpg: Don't crash if key is not passed an argument.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Dec 9 20:32:10 UTC 2015


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

dkg pushed a commit to branch master
in repository gnupg2.

commit 19f099463c82c119288a05eaefc42bf09d617377
Author: Neal H. Walfield <neal at g10code.com>
Date:   Mon Nov 23 11:21:24 2015 +0100

    gpg: Don't crash if key is not passed an argument.
    
    * g10/keyedit.c (menu_select_key): Don't crash if P is NULL.
    
    --
    Signed-off-by: Neal H. Walfield <neal at g10code.com>
---
 g10/keyedit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/g10/keyedit.c b/g10/keyedit.c
index 5fc92b2..8320aa4 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -4892,8 +4892,9 @@ menu_select_key (KBNODE keyblock, int idx, char *p)
 {
   KBNODE node;
   int i, j;
-  int is_hex_digits = strlen (p) >= 8;
+  int is_hex_digits;
 
+  is_hex_digits = p && strlen (p) >= 8;
   if (is_hex_digits)
     {
       for (i = 0, j = 0; p[i]; i ++)

-- 
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