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@g10code.com>
This commit is contained in:
Neal H. Walfield 2015-11-23 11:21:24 +01:00
parent 178af9c3f5
commit 19f099463c
1 changed files with 2 additions and 1 deletions

View File

@ -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 ++)