From b4ce4d228d0997124493f9b7feb9b057534d7041 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Fri, 9 Feb 2018 15:11:41 +0100 Subject: [PATCH] JSON-RPC: Fix unquoted error string when parser fails Fixes #963 Reported-by: @shesek Signed-off-by: Christian Decker --- lightningd/jsonrpc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lightningd/jsonrpc.c b/lightningd/jsonrpc.c index 32a4a2f4b..790a608f4 100644 --- a/lightningd/jsonrpc.c +++ b/lightningd/jsonrpc.c @@ -429,9 +429,8 @@ static void json_command_malformed(struct json_connection *jcon, const char *id, const char *error) { - return connection_result(jcon, id, NULL, error, - JSONRPC2_INVALID_REQUEST, - NULL); + return connection_result(jcon, id, NULL, tal_fmt(jcon, "\"%s\"", error), + JSONRPC2_INVALID_REQUEST, NULL); } static void parse_request(struct json_connection *jcon, const jsmntok_t tok[])