Skip to content

Conversation

@dovgopoly
Copy link
Collaborator

@dovgopoly dovgopoly commented Dec 10, 2025

Fixes #8442

parse_filter() expects a JSMN_OBJECT. When not a JSMN_OBJECT is passed to the filter parameter, it called command_fail_badparam() which called command_log() that tried to access c->json_cmd->name, but c->json_cmd was still NULL because find_cmd() hadn't been called yet.

Example that triggered the crash:
./cli/lightning-cli wait -l 'invalid_json_object' -k subsystem=invoices indexname=created nextvalue=0 --network regtest

@madelinevibes
Copy link
Collaborator

@ShahanaFarooqui has investigated the CI failures... Christian and Rusty are working on resolving some CI problems right now.
Once their fixes are applied, we'll get you to rebase and take a closer look if it still fails.

Shahana also noticed you forgot to add a Changelog entry in the commit.... here is the guide. You'll need to fix this: a very important habit! Not adding a Changelog entry can also fail CI (when it's working as expected).

Well done and congratulations on your first PR for CLN!

Changelog-Fixed: Fixes a crash in parse_filter() when a non-object JSON is passed to the filter parameter
@ShahanaFarooqui
Copy link
Collaborator

@dovgopoly Thanks for the PR! I updated your commit message to include a changelog entry. Normally, the CI would fail with a clear error like:

::error::'Changelog' entry is missing in all commits, and 'Changelog-None' not specified in the PR description

However, for some strange reason, the CI didn’t even start the pre-build this time. Adding the changelog message allowed the CI to proceed, and we can investigate further if this issue happens again.

By the way, feel free to edit the commit message as you see fit, I just added it to test the CI flow. :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bad jsonrpc filter crashes node

3 participants