Skip to content

Commit

Permalink
connectd: fix crash when we get an incoming conn while outgoing attem…
Browse files Browse the repository at this point in the history
…pt 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
  • Loading branch information
rustyrussell committed Nov 28, 2024
1 parent 36ad654 commit 2e90f59
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions connectd/connectd.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,10 @@ struct io_plan *peer_connected(struct io_conn *conn,

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

Expand Down

0 comments on commit 2e90f59

Please sign in to comment.