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 8 times, most recently from 41d2e8c to 812a8fd Compare May 22, 2026 04:03
@nekohasekai nekohasekai force-pushed the testing branch 4 times, most recently from 4de2400 to ba2d6c6 Compare May 31, 2026 10:04
@nekohasekai nekohasekai force-pushed the testing branch 2 times, most recently from 83b7304 to 8a42af3 Compare June 8, 2026 00:52
@nekohasekai nekohasekai force-pushed the testing branch 12 times, most recently from 8ea55ff to a9fe3f3 Compare June 17, 2026 06:56
@nekohasekai nekohasekai force-pushed the testing branch 4 times, most recently from f7ca395 to f27d0e3 Compare June 21, 2026 04:16
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