Skip to content

Commit 2e90f59

Browse files
committed
connectd: fix crash when we get an incoming conn while outgoing attempt is ratelimited.
``` Program received signal SIGSEGV, Segmentation fault. 0x000000001014e9d8 in io_set_finish_ (conn=0x0, finish=0x0, arg=0x0) at ccan/ccan/io/io.c:137 137 conn->finish = finish; (gdb) bt incoming=true) at connectd/connectd.c:394 ``` Fixes: #7871 Reported-by: grubles Signed-off-by: Rusty Russell <[email protected]> Changelog-None: broken in this release
1 parent 36ad654 commit 2e90f59

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

connectd/connectd.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,10 @@ struct io_plan *peer_connected(struct io_conn *conn,
390390

391391
if (connect) {
392392
/*~ Now we've connected, disable the callback which would
393-
* cause us to to try the next address on failure. */
394-
io_set_finish(connect->conn, NULL, NULL);
393+
* cause us to to try the next address on failure (if it's
394+
* in progress right now) */
395+
if (connect->conn)
396+
io_set_finish(connect->conn, NULL, NULL);
395397
tal_free(connect);
396398
}
397399

0 commit comments

Comments
 (0)