Skip to content

lightningd: initialize error pointer in connect_activate_subd and handle_splice_abort - #9449

Open
Andezion wants to merge 1 commit into
ElementsProject:masterfrom
Andezion:fix/uninitialized-error-ptr-9442
Open

lightningd: initialize error pointer in connect_activate_subd and handle_splice_abort#9449
Andezion wants to merge 1 commit into
ElementsProject:masterfrom
Andezion:fix/uninitialized-error-ptr-9442

Conversation

@Andezion

Copy link
Copy Markdown
Collaborator

Fixes #9442

Same uninitialized-pointer pattern as #8849 (fixed in 090f4b0 for handle_peer_spoke) also exists in:

  • connect_activate_subd() in lightningd/peer_control.c
  • handle_splice_abort() in lightningd/channel_control.c

In both, const u8 *error - is declared uninitialized and only conditionally set via sockpair(..., &error) before falling through to a path that dereferences it. sockpair() currently always sets the output pointer on failure, so this isn't exploitable today, but the declaration should still default to NULL defensively in case that invariant ever breaks

Fix: initialize both declarations to NULL.

Testing: compiled lightningd/channel_control.o and lightningd/peer_control.o cleanly - no behavior change on existing paths

Important

26.09 FREEZE August 5th: Non-bugfix PRs not ready by this date will wait for 26.12.

RC1 is scheduled on August 17th

The final release is scheduled for September 7th.

Checklist

Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:

  • The changelog has been updated in the relevant commit(s) according to the guidelines.
  • Tests have been added or modified to reflect the changes.
  • Documentation has been reviewed and updated as needed.
  • Related issues have been listed and linked, including any that this PR closes.
  • Important All PRs must consider how to reverse any persistent changes for tools/lightning-downgrade

@Andezion Andezion self-assigned this Aug 27, 2026
@Andezion
Andezion force-pushed the fix/uninitialized-error-ptr-9442 branch from ab7cad7 to a6e57cc Compare August 27, 2026 09:58
@Andezion Andezion added the Status::Ready for Review The work has been completed and is now awaiting evaluation or approval. label Aug 27, 2026
@madelinevibes madelinevibes added this to the v26.09 milestone Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status::Ready for Review The work has been completed and is now awaiting evaluation or approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error paths dereference an uninitialized pointer

2 participants