Skip to content

Commit 5a530e6

Browse files
committed
lightningd: fix crash in channel_control.
I got a NULL deref on `infcopy->remote_funding = *inflight->funding->splice_remote_funding` at once point in testing, so this should prevent that from happening, yet still allow us to catch it in CI if it happens again. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 89eaf83 commit 5a530e6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lightningd/channel_control.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <ccan/cast/cast.h>
44
#include <ccan/tal/str/str.h>
55
#include <channeld/channeld_wiregen.h>
6+
#include <common/daemon.h>
67
#include <common/json_command.h>
78
#include <common/psbt_open.h>
89
#include <common/shutdown_scriptpubkey.h>
@@ -1818,6 +1819,11 @@ bool peer_start_channeld(struct channel *channel,
18181819
if (inflight->splice_locked_memonly)
18191820
continue;
18201821

1822+
if (!inflight->funding->splice_remote_funding) {
1823+
send_backtrace("Inflight has no splice_remote_funding?!");
1824+
continue;
1825+
}
1826+
18211827
infcopy = tal(inflights, struct inflight);
18221828

18231829
infcopy->remote_funding = *inflight->funding->splice_remote_funding;

0 commit comments

Comments
 (0)