Router: Fix panic in ProcessNameMatcher when source IPs are empty (#5574)

Fixes https://github.com/XTLS/Xray-core/issues/5573
This commit is contained in:
风扇滑翔翼
2026-01-21 21:24:51 +08:00
committed by GitHub
parent 30d6a5221b
commit 777e31302c

View File

@@ -358,6 +358,9 @@ func NewProcessNameMatcher(names []string) *ProcessNameMatcher {
}
func (m *ProcessNameMatcher) Apply(ctx routing.Context) bool {
if len(ctx.GetSourceIPs()) == 0 {
return false
}
srcPort := ctx.GetSourcePort().String()
srcIP := ctx.GetSourceIPs()[0].String()
var network string