mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
jsonrpc: fix error when we abort batching due to timeout.
The read_json() call expects len_read to be the amount of *new* data read. If we call this back without resetting, it will parse this much random junk in the buffer. Fixes: #5766 Changelog-Fixed: Plugin: `autoclean` could misperform or get killed due to lightningd's invalid handling of JSON batching.
This commit is contained in:
parent
24d7aad3d0
commit
9751502ff5
1 changed files with 2 additions and 0 deletions
|
@ -1109,6 +1109,8 @@ again:
|
|||
start_time),
|
||||
time_from_msec(250))) {
|
||||
db_commit_transaction(jcon->ld->wallet->db);
|
||||
/* Call us back, as if we read nothing new */
|
||||
jcon->len_read = 0;
|
||||
return io_always(conn, read_json, jcon);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue