Skip to content

selector: avoid nil deref when no outbound is selected#4102

Open
SAY-5 wants to merge 2 commits intoSagerNet:testingfrom
SAY-5:say5/selector-nil-selected-3917
Open

selector: avoid nil deref when no outbound is selected#4102
SAY-5 wants to merge 2 commits intoSagerNet:testingfrom
SAY-5:say5/selector-nil-selected-3917

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 2, 2026

Fixes #3917.

Selector.DialContext/ListenPacket/NewConnection/NewPacketConnection/NewDirectRouteConnection all called s.selected.Load() and immediately dereferenced the result. Network() and Now() already nil-check; the connection-side methods didn't. After SFA disconnect+reconnect, selected can be nil and the next dial panics — guard each callsite.

nekohasekai and others added 2 commits April 28, 2026 18:35
@nekohasekai nekohasekai force-pushed the testing branch 2 times, most recently from 8f15b13 to 9ee56ae Compare May 3, 2026 01:08
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.

Selector outbound causes nil pointer panic on reconnect when used as Tailscale endpoint detour (SFA)

2 participants