mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-01-04 00:23:43 +08:00
fix: Vision slice out of bounds error
This commit is contained in:
parent
9442880a5a
commit
4af4935e7e
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user