Skip to content

Commit

Permalink
lightningd: unescape JSON strings for db.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Changelog-Fixed: JSON-RPC: `datastore` handles escapes in `string` parameter correctly.
  • Loading branch information
rustyrussell authored and endothermicdev committed Feb 11, 2023
1 parent 15a744b commit 9a77a99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lightningd/datastore.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static struct command_result *json_datastore(struct command *cmd,

if (!param(cmd, buffer, params,
p_req("key", param_list_or_string, &key),
p_opt("string", param_string, &strdata),
p_opt("string", param_escaped_string, &strdata),
p_opt("hex", param_bin_from_hex, &data),
p_opt_def("mode", param_mode, &mode, DS_MUST_NOT_EXIST),
p_opt("generation", param_u64, &generation),
Expand Down

0 comments on commit 9a77a99

Please sign in to comment.