mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-03 22:34:21 +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:
committed by
Christian Decker
parent
24d7aad3d0
commit
9751502ff5
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user