Skip to content

Commit 9a77a99

Browse files
rustyrussellendothermicdev
authored andcommitted
lightningd: unescape JSON strings for db.
We were feeding in the raw JSON, which escapes \". Then we were escaping *again* to return it. Reported-by: @m-schmook Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Fixed: JSON-RPC: `datastore` handles escapes in `string` parameter correctly.
1 parent 15a744b commit 9a77a99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightningd/datastore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static struct command_result *json_datastore(struct command *cmd,
136136

137137
if (!param(cmd, buffer, params,
138138
p_req("key", param_list_or_string, &key),
139-
p_opt("string", param_string, &strdata),
139+
p_opt("string", param_escaped_string, &strdata),
140140
p_opt("hex", param_bin_from_hex, &data),
141141
p_opt_def("mode", param_mode, &mode, DS_MUST_NOT_EXIST),
142142
p_opt("generation", param_u64, &generation),

0 commit comments

Comments
 (0)