From 4af4935e7edebed6a8f799643d734fa81909e10f Mon Sep 17 00:00:00 2001 From: Hellojack <106379370+h1jk@users.noreply.github.com> Date: Sat, 1 Apr 2023 20:08:49 +0800 Subject: [PATCH] fix: Vision slice out of bounds error --- transport/vless/filter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transport/vless/filter.go b/transport/vless/filter.go index 3ddfb8b9..f577be7a 100644 --- a/transport/vless/filter.go +++ b/transport/vless/filter.go @@ -34,7 +34,7 @@ func (vc *Conn) FilterTLS(buffer []byte) (index int) { lenP := len(buffer) vc.packetsToFilter-- if index = bytes.Index(buffer, tlsServerHandshakeStart); index != -1 { - if lenP >= index+5 { + if lenP > index+5 { if buffer[0] == 22 && buffer[1] == 3 && buffer[2] == 3 { vc.isTLS = true if buffer[5] == tlsHandshakeTypeServerHello { @@ -49,7 +49,7 @@ func (vc *Conn) FilterTLS(buffer []byte) (index int) { } } } else if index = bytes.Index(buffer, tlsClientHandshakeStart); index != -1 { - if lenP >= index+5 && buffer[index+5] == tlsHandshakeTypeClientHello { + if lenP > index+5 && buffer[index+5] == tlsHandshakeTypeClientHello { vc.isTLS = true } }