aboutsummaryrefslogtreecommitdiffstats
path: root/g10/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/misc.c')
-rw-r--r--g10/misc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/g10/misc.c b/g10/misc.c
index c7107be06..a606d5364 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -922,6 +922,11 @@ pct_expando (ctrl_t ctrl, const char *string,struct expando_args *args)
u32 pk_keyid[2]={0,0},sk_keyid[2]={0,0};
char *ret=NULL;
+ /* The parser below would return NULL for an empty string, thus we
+ * catch it here. Also catch NULL here. */
+ if (!string || !*string)
+ return xstrdup ("");
+
if(args->pk)
keyid_from_pk(args->pk,pk_keyid);