Skip to content

(Actually) remove incorrect *mut cast in net-tokio#4694

Merged
TheBlueMatt merged 1 commit into
lightningdevkit:mainfrom
TheBlueMatt:2026-06-mut-aliasing
Jun 15, 2026
Merged

(Actually) remove incorrect *mut cast in net-tokio#4694
TheBlueMatt merged 1 commit into
lightningdevkit:mainfrom
TheBlueMatt:2026-06-mut-aliasing

Conversation

@TheBlueMatt

Copy link
Copy Markdown
Collaborator

In ae62fa3 we removed an incorrect &mut, but failed to actually resolve the mut aliasing bug - there remained a deref of a *mut which is similarly invalid. Here we actually fix the bug and also DRY up code marginally.

Reported by Project Loupe.

In ae62fa3 we removed an incorrect
`&mut`, but failed to actually resolve the mut aliasing bug - there
remained a deref of a `*mut` which is similarly invalid. Here we
actually fix the bug and also DRY up code marginally.

Reported by Project Loupe.
@ldk-reviews-bot

ldk-reviews-bot commented Jun 15, 2026

Copy link
Copy Markdown

👋 Thanks for assigning @valentinewallace as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@ldk-claude-review-bot

Copy link
Copy Markdown
Collaborator

The change correctly delegates to wake_socket_waker_by_ref (which uses a *const deref via &*sender_ptr, avoiding the invalid *mut deref) and then drops the waker. The semantics are preserved: wake consumes the waker so it still calls drop_socket_waker, while wake_by_ref does not.

No issues found.

@ldk-reviews-bot

Copy link
Copy Markdown

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

@TheBlueMatt
TheBlueMatt merged commit 266d594 into lightningdevkit:main Jun 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants