From 10683b1a913c39238c9871f5aa607334f32467f7 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Fri, 25 May 2018 14:50:20 +0200 Subject: [PATCH] json: Add guard in create_keylist_patterns * src/gpgme-json.c (create_keylist_patterns): Guard against a string ending with a linbreak. --- src/gpgme-json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gpgme-json.c b/src/gpgme-json.c index eb5edf4d..3cdd744d 100644 --- a/src/gpgme-json.c +++ b/src/gpgme-json.c @@ -691,7 +691,7 @@ create_keylist_patterns (cjson_t request) tmp = p + 1; } /* The last key is not newline delimted. */ - ret[i++] = xstrdup (tmp); + ret[i++] = *tmp ? xstrdup (tmp) : NULL; ret[i] = NULL; xfree (keystring);