Explorar o código

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

Fixes https://github.com/XTLS/Xray-core/issues/5573
风扇滑翔翼 hai 4 meses
pai
achega
777e31302c
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      app/router/condition.go

+ 3 - 0
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