From 99300dbd265f2ec6577d1fbdf75cbb5394c804d9 Mon Sep 17 00:00:00 2001 From: Erick Cestari Date: Tue, 8 Sep 2026 14:59:03 -0300 Subject: [PATCH] dualopend: initialize state->reconnected on startup state->reconnected was only set to true after do_reconnect_dance(), so a fresh dualopend never wrote it. A commitment_signed arriving out of turn in the main loop made handle_commit_signed() read an uninitialized bool, which UBSan flags as a load of an invalid bool value. Default it to false, so an out-of-turn commitment_signed is always rejected unless we really reconnected. Changelog-None Signed-off-by: Erick Cestari --- openingd/dualopend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openingd/dualopend.c b/openingd/dualopend.c index 2f1849773496..ac8e4561984a 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -4325,8 +4325,9 @@ int main(int argc, char *argv[]) * writing to REQ_FD */ status_setup_sync(REQ_FD); - /* Init state to not aborted */ + /* Init state to not aborted, and not reconnected until we know better */ state->aborted_err = NULL; + state->reconnected = false; /*~ The very first thing we read from lightningd is our init msg */ msg = wire_sync_read(tmpctx, REQ_FD);