From 777e31302cf04fedb9c233f2036bec0c90c8be8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E6=89=87=E6=BB=91=E7=BF=94=E7=BF=BC?= Date: Wed, 21 Jan 2026 21:24:51 +0800 Subject: [PATCH] Router: Fix panic in ProcessNameMatcher when source IPs are empty (#5574) Fixes https://github.com/XTLS/Xray-core/issues/5573 --- app/router/condition.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/router/condition.go b/app/router/condition.go index ca4f9605..c063bae3 100644 --- a/app/router/condition.go +++ b/app/router/condition.go @@ -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