cln/plugins
Rusty Russell 2f2b3b8180 plugins/pay: don't crash if erring index is past route array end.
I assume this happens with multi-hop routehints?

```
1768169599027	2026-01-11T22:13:19.027Z	pay: plugins/libplugin-pay.c:1199: payment_result_infer: Assertion `i <= len' failed.
1768169599027	2026-01-11T22:13:19.027Z	pay: FATAL SIGNAL 6 (version 25.12)
1768169599036	2026-01-11T22:13:19.036Z	0x5562816bcaa4 send_backtrace
1768169599036	2026-01-11T22:13:19.036Z		common/daemon.c:38
1768169599036	2026-01-11T22:13:19.036Z	0x5562816bcb40 crashdump
1768169599036	2026-01-11T22:13:19.036Z		common/daemon.c:83
1768169599036	2026-01-11T22:13:19.036Z	0x7f5fca29d32f ???
1768169599036	2026-01-11T22:13:19.036Z		???:0
1768169599036	2026-01-11T22:13:19.036Z	0x7f5fca2f6b2c ???
1768169599036	2026-01-11T22:13:19.036Z		pthread_kill+0x11c:0
1768169599036	2026-01-11T22:13:19.036Z	0x7f5fca29d27d ???
1768169599036	2026-01-11T22:13:19.036Z		gsignal+0x1d:0
1768169599036	2026-01-11T22:13:19.036Z	0x7f5fca2808fe ???
1768169599036	2026-01-11T22:13:19.036Z		abort+0xde:0
1768169599036	2026-01-11T22:13:19.036Z	0x7f5fca28081a ???
1768169599036	2026-01-11T22:13:19.036Z		???:0
1768169599036	2026-01-11T22:13:19.036Z	0x7f5fca293516 ???
1768169599036	2026-01-11T22:13:19.036Z		__assert_fail+0x46:0
1768169599037	2026-01-11T22:13:19.037Z	0x5562816ae9f6 payment_result_infer
1768169599037	2026-01-11T22:13:19.037Z		plugins/libplugin-pay.c:1199
1768169599037	2026-01-11T22:13:19.037Z	0x5562816b4acd payment_waitsendpay_finished
1768169599037	2026-01-11T22:13:19.037Z		plugins/libplugin-pay.c:1653
1768169599037	2026-01-11T22:13:19.037Z	0x5562816aca60 handle_rpc_reply
1768169599037	2026-01-11T22:13:19.037Z		plugins/libplugin.c:1062
1768169599037	2026-01-11T22:13:19.037Z	0x5562816acc86 rpc_conn_read_response
1768169599037	2026-01-11T22:13:19.037Z		plugins/libplugin.c:1377
1768169599037	2026-01-11T22:13:19.037Z	0x5562816f0e87 next_plan
1768169599037	2026-01-11T22:13:19.037Z		ccan/ccan/io/io.c:60
1768169599037	2026-01-11T22:13:19.037Z	0x5562816f1358 do_plan
1768169599037	2026-01-11T22:13:19.037Z		ccan/ccan/io/io.c:422
1768169599037	2026-01-11T22:13:19.037Z	0x5562816f1415 io_ready
1768169599037	2026-01-11T22:13:19.037Z		ccan/ccan/io/io.c:439
1768169599037	2026-01-11T22:13:19.037Z	0x5562816f2e23 io_loop
1768169599037	2026-01-11T22:13:19.037Z		ccan/ccan/io/poll.c:470
1768169599037	2026-01-11T22:13:19.037Z	0x5562816ae114 plugin_main
1768169599037	2026-01-11T22:13:19.037Z		plugins/libplugin.c:2429
1768169599037	2026-01-11T22:13:19.037Z	0x5562816a894c main
1768169599037	2026-01-11T22:13:19.037Z		plugins/pay.c:1581
1768169599037	2026-01-11T22:13:19.037Z	0x7f5fca2821c9 ???
1768169599037	2026-01-11T22:13:19.037Z		???:0
1768169599037	2026-01-11T22:13:19.037Z	0x7f5fca28228a ???
1768169599037	2026-01-11T22:13:19.037Z		__libc_start_main+0x8a:0
1768169599037	2026-01-11T22:13:19.037Z	0x5562816a4eb4 ???
1768169599037	2026-01-11T22:13:19.037Z		_start+0x24:0
1768169599037	2026-01-11T22:13:19.037Z	0xffffffffffffffff ???
1768169599037	2026-01-11T22:13:19.037Z		???:0
1768169599136	2026-01-11T22:13:19.136Z	2026-01-11T22:13:19.136Z INFO    plugin-pay: Killing plugin: exited during normal operation
69599136	2026-01-11T22:13:19.136Z	2026-01-11T22:13:19.136Z **BROKEN** plugin-pay: Plugin marked as important, shutting down lightningd!
```

Reported-by: michael1011
Fixes: https://github.com/ElementsProject/lightning/issues/8828
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: plugins: `pay` can crash on errors returned from deep inside routehints.
2026-01-14 17:22:42 +10:30
..
askrene askrene: don't crash if refining flow which has capacity greaater than max it should have. 2026-01-14 17:22:42 +10:30
bip353-plugin docker: Dockerfile fixes after poetry to uv migration 2025-09-09 10:46:23 +09:30
bkpr bookkeeper: restore limit on asking for all channelmoves at once. 2025-11-20 16:30:50 +10:30
examples cln-plugin: trace level logging support 2025-05-05 09:31:22 -07:00
grpc-plugin crates: centralize version management 2025-11-14 09:02:35 +10:30
lsps-plugin plugin: change method name of lsps-jitchannel 2025-11-21 13:48:29 +10:30
renepay common: add amount_msat_deduct / amount_msat_deduct_sub. 2025-11-17 10:56:18 +10:30
rest-plugin crates: centralize version management 2025-11-14 09:02:35 +10:30
spender lightningd: immediately close without broadcast whenever we close a withheld channel. 2025-11-19 07:23:39 +10:30
src cln-plugin: adapt send_custom_notification to send modern-style notifications. 2025-08-18 10:01:07 +09:30
test global: remove unnecessary includes from C files. 2025-10-23 06:44:04 +10:30
wss-proxy-plugin crates: centralize version management 2025-11-14 09:02:35 +10:30
xpay xpay: fix misleading "route hint" label in error messages 2025-11-29 08:33:37 +10:30
.gitignore lsps: Add service implementation for LSPS0 2025-05-02 13:34:21 -07:00
autoclean.c global: use clock_time in place of time_now(). 2025-11-13 21:21:29 +10:30
bcli.c lightningd: deprecate "message": null in channel_state_changed notifications. 2025-11-18 14:28:22 +10:30
Cargo.toml crates: centralize version management 2025-11-14 09:02:35 +10:30
chanbackup.c commando, chanbackup: use custommsg hooks. 2025-11-20 16:30:50 +10:30
channel_hint.c common: add new_htable() macro to allocate, initialize and setup memleak coverage for any typed hash table. 2025-10-24 11:30:17 +10:30
channel_hint.h global: remove unnecessary includes from headers. 2025-10-23 06:44:04 +10:30
commando.c commando, chanbackup: use custommsg hooks. 2025-11-20 16:30:50 +10:30
establish_onion_path.c global: remove unnecessary includes from C files. 2025-10-23 06:44:04 +10:30
establish_onion_path.h global: remove unnecessary includes from headers. 2025-10-23 06:44:04 +10:30
exposesecret.c ccan: update to get improved grab_file API, and adapt code. 2025-10-26 12:37:58 +10:30
fetchinvoice.c global: use clock_time in place of time_now(). 2025-11-13 21:21:29 +10:30
fetchinvoice.h plugins: cancelrecurringinvoice command. 2025-10-01 15:31:30 +09:30
funder.c plugins: fix %*.s typo. 2025-10-24 11:28:57 +10:30
funder_policy.c global: remove unnecessary includes from C files. 2025-10-23 06:44:04 +10:30
funder_policy.h libplugin: allow display of default values. 2024-05-15 15:50:54 -05:00
keysend.c global: use clock_time in place of time_now(). 2025-11-13 21:21:29 +10:30
libplugin-pay.c plugins/pay: don't crash if erring index is past route array end. 2026-01-14 17:22:42 +10:30
libplugin-pay.h connectd, gossipd, pay, bcli: use timemono when solely measuring duration for timeouts. 2025-11-13 21:21:29 +10:30
libplugin.c libplugin: don't wait for clean_tmpctx() to free requests as we process them. 2025-11-20 16:30:50 +10:30
libplugin.h libplugin: allow plugins to register optional filters for each hook they want. 2025-11-20 16:30:50 +10:30
Makefile sql: add support for listnetworkevents 2025-11-12 13:58:43 +10:30
offers.c offers: make find_best_peer take a feature bitmap. 2025-11-18 14:31:04 +10:30
offers.h offers: make find_best_peer take a feature bitmap. 2025-11-18 14:31:04 +10:30
offers_inv_hook.c global: use clock_time in place of time_now(). 2025-11-13 21:21:29 +10:30
offers_inv_hook.h offers: check they use the blinded path if one is specified. 2024-07-17 10:57:11 +02:00
offers_invreq_hook.c offers: require opt_onion_message for incoming invoices too. 2025-11-18 14:31:04 +10:30
offers_invreq_hook.h offers: check they use the blinded path if one is specified. 2024-07-17 10:57:11 +02:00
offers_offer.c offers: make find_best_peer take a feature bitmap. 2025-11-18 14:31:04 +10:30
offers_offer.h plugins: move fetchinvoice functionality into offers plugin. 2024-07-17 10:57:11 +02:00
pay.c global: use clock_time in place of time_now(). 2025-11-13 21:21:29 +10:30
README.md doc: fix wording in plugins/README.md 2020-01-06 12:57:59 +01:00
recklessrpc.c global: remove unnecessary includes from C files. 2025-10-23 06:44:04 +10:30
recover.c global: remove unnecessary includes from C files. 2025-10-23 06:44:04 +10:30
sql.c sql: limit how many chainmoves/channelmoves entries we ask for at once. 2025-11-20 16:30:50 +10:30
topology.c topology: in deterministic mode, only return one best candidate for listincoming. 2025-11-13 21:21:29 +10:30
txprepare.c plugins: fix %*.s typo. 2025-10-24 11:28:57 +10:30

Plugin Directory

Any file in this directory which is executable and whose name only consists of alphanumeric characters, space, '.', '-' or '_' will be automatically loaded when lightningd starts (unless suppressed with commandline options).