DomainMatcher: Fix Match() result slice aliasing race (#5959)

Fixes https://github.com/XTLS/Xray-core/pull/5814
This commit is contained in:
Meow
2026-04-18 06:07:58 +08:00
committed by GitHub
parent cb1106c2fb
commit d42c981f9c
5 changed files with 34 additions and 6 deletions
+4
View File
@@ -11,7 +11,11 @@ import (
)
type DomainMatcher interface {
// Match returns the indices of all rules that match the input domain.
// The returned slice is owned by the caller and may be safely modified.
// Note: the slice may contain duplicates and the order is unspecified.
Match(input string) []uint32
MatchAny(input string) bool
}