aboutsummaryrefslogtreecommitdiffstats
path: root/agent/findkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'agent/findkey.c')
-rw-r--r--agent/findkey.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/agent/findkey.c b/agent/findkey.c
index e57a5c6c5..cab3691e7 100644
--- a/agent/findkey.c
+++ b/agent/findkey.c
@@ -143,13 +143,19 @@ modify_description (const char *description,
const char *comment, size_t comment_length,
char **description_modified)
{
- size_t description_length = strlen (description);
+ size_t description_length = description ? strlen (description) : 0;
size_t description_new_length = description_length;
gpg_error_t err = GPG_ERR_NO_ERROR;
char *description_new = NULL;
unsigned int i = 0, j = 0;
unsigned int special = 0;
+ if (! description)
+ {
+ *description_modified = NULL;
+ return err;
+ }
+
/* Calculate length. */
for (i = 0; i < description_length; i++)
{