summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heinecke <aheinecke@intevation.de>2018-05-25 14:50:20 +0200
committerAndre Heinecke <aheinecke@intevation.de>2018-05-25 14:50:20 +0200
commit10683b1a913c39238c9871f5aa607334f32467f7 (patch)
treee37964964433a4b2d29770110cd5b4240e898cb6
parent1ff16dad595946af140b324fad2bceca7ddbc378 (diff)
downloadgpgme-10683b1a913c39238c9871f5aa607334f32467f7.tar.gz
json: Add guard in create_keylist_patterns
* src/gpgme-json.c (create_keylist_patterns): Guard against a string ending with a linbreak.
-rw-r--r--src/gpgme-json.c2
1 files changed, 1 insertions, 1 deletions
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);