aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal H. Walfield <[email protected]>2015-11-23 10:21:24 +0000
committerNeal H. Walfield <[email protected]>2015-11-23 10:21:24 +0000
commit19f099463c82c119288a05eaefc42bf09d617377 (patch)
treef0b7f34eaf179aec0cc990f8214f096336792004
parentgpg: Fail if the search description passed to --gen-revoke is ambiguous. (diff)
downloadgnupg-19f099463c82c119288a05eaefc42bf09d617377.tar.gz
gnupg-19f099463c82c119288a05eaefc42bf09d617377.zip
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 <[email protected]>
-rw-r--r--g10/keyedit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/g10/keyedit.c b/g10/keyedit.c
index 5fc92b2c7..8320aa4f4 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 ++)