mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-07 08:04:23 +01:00
offers: save replytok properly.
We carefully copied the buffer, but the tok is inside an array. We get away with it for now, but with coming changes it gets freed. We need to copy the token and all the tokens within it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
a71f2475d5
commit
af7e0a1183
@@ -838,7 +838,8 @@ struct command_result *handle_invoice_request(struct command *cmd,
|
||||
|
||||
/* Make a copy of entire buffer, for later. */
|
||||
ir->buf = tal_dup_arr(ir, char, buf, replytok->end, 0);
|
||||
ir->replytok = replytok;
|
||||
ir->replytok = tal_dup_arr(ir, jsmntok_t, replytok,
|
||||
json_next(replytok) - replytok, 0);
|
||||
|
||||
ir->invreq = tlv_invoice_request_new(cmd);
|
||||
if (!fromwire_invoice_request(&invreqbin, &len, ir->invreq)) {
|
||||
|
||||
Reference in New Issue
Block a user