JSON-RPC: Fix unquoted error string when parser fails

Fixes #963

Reported-by: @shesek
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2018-02-09 15:11:41 +01:00
parent fe670b9aaa
commit b4ce4d228d

View File

@@ -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[])