Skip to content

fix(vless): dereference packet_encoding in error message to avoid panic#4094

Open
Leadaxe wants to merge 67 commits into
SagerNet:testingfrom
Leadaxe:fix/vless-packet-encoding-panic
Open

fix(vless): dereference packet_encoding in error message to avoid panic#4094
Leadaxe wants to merge 67 commits into
SagerNet:testingfrom
Leadaxe:fix/vless-packet-encoding-panic

Conversation

@Leadaxe

@Leadaxe Leadaxe commented Apr 28, 2026

Copy link
Copy Markdown

Fixes #4093.

protocol/vless/outbound.go:86 passed options.PacketEncoding (a *string) to E.New. common/format.ToString has no case for pointer types, so the call panicked instead of returning the intended error. Adding the dereference makes the path produce a normal FATAL initialize outbound[0]: unknown packet encoding: <value>, matching what the analogous VMess code at protocol/vmess/outbound.go:81 already emits (where PacketEncoding is a plain string).

Verified locally: with the patch applied, sing-box check -c <config-with-packet_encoding-none> returns the FATAL line and exits 1, instead of panic: unknown value + stack trace.

Diff is one character.

@nekohasekai nekohasekai force-pushed the testing branch 5 times, most recently from 057f540 to 6b07a22 Compare May 15, 2026 05:29
@nekohasekai nekohasekai force-pushed the testing branch 9 times, most recently from 2141845 to b6c416b Compare May 26, 2026 09:45
@nekohasekai nekohasekai force-pushed the testing branch 3 times, most recently from de161cf to 83b7304 Compare June 3, 2026 05:05
@nekohasekai nekohasekai force-pushed the testing branch 7 times, most recently from 1ed57eb to 8247670 Compare June 13, 2026 15:01
@nekohasekai nekohasekai force-pushed the testing branch 6 times, most recently from 8ea55ff to a9fe3f3 Compare June 17, 2026 06:56
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.

[Bug] VLESS outbound: panic("unknown value") instead of error on invalid packet_encoding

2 participants