diff options
author | Andre Heinecke <[email protected]> | 2018-05-25 12:50:20 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2018-05-25 12:50:20 +0000 |
commit | 10683b1a913c39238c9871f5aa607334f32467f7 (patch) | |
tree | e37964964433a4b2d29770110cd5b4240e898cb6 | |
parent | json: Implement import operation (diff) | |
download | gpgme-10683b1a913c39238c9871f5aa607334f32467f7.tar.gz gpgme-10683b1a913c39238c9871f5aa607334f32467f7.zip |
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.c | 2 |
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); |