Skip to content

Commit

Permalink
lightning-cli: fix malformed response bug
Browse files Browse the repository at this point in the history
Changelog-Fixed: lightning-cli: fix "malformed response" bug

Signed-off-by: Lagrang3 <[email protected]>
  • Loading branch information
Lagrang3 committed Dec 10, 2024
1 parent cb1bd82 commit 8089be7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cli/lightning-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,10 +860,8 @@ int main(int argc, char *argv[])
default:
if (handle_notify(resp, toks, notification_level,
&last_was_progress)) {
/* +2 for \n\n */
size_t len = toks[0].end - toks[0].start + 2;
memmove(resp, resp + len, off - len);
off -= len;
memmove(resp, resp + toks[0].end, off - toks[0].end);
off -= toks[0].end;
jsmn_init(&parser);
toks[0].type = JSMN_UNDEFINED;
/* Don't force another read! */
Expand Down

0 comments on commit 8089be7

Please sign in to comment.