From 7d3c13df263ed88c17005920e75e0486abeae5b9 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Tue, 28 Aug 2018 08:05:30 +0200 Subject: [PATCH] json: Allow NULL request in encode and chunk * src/gpgme-json.c (encode_and_chunk): Don't error on NULL request. -- This fixes the error that is passed when parthing the json object failed and request would be NULL. Instead of the JSON parser error it would otherwise report that encode and chunk failed. --- src/gpgme-json.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gpgme-json.c b/src/gpgme-json.c index 8812024c..0d1ec508 100644 --- a/src/gpgme-json.c +++ b/src/gpgme-json.c @@ -1521,7 +1521,7 @@ encode_and_chunk (cjson_t request, cjson_t response) { char *data; gpg_error_t err = 0; - size_t chunksize; + size_t chunksize = 0; char *getmore_request = NULL; if (opt_interactive) @@ -1537,7 +1537,6 @@ encode_and_chunk (cjson_t request, cjson_t response) if (!request) { - err = GPG_ERR_INV_VALUE; goto leave; }