mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-14 21:31:16 +08:00
fix: Filter slice index out of bounds
This commit is contained in:
parent
0a6705f43e
commit
2cbfac2c89
@ -51,14 +51,18 @@ func (vc *Conn) FilterTLS(p []byte) (index int) {
|
||||
|
||||
if vc.remainingServerHello > 0 {
|
||||
end := int(vc.remainingServerHello)
|
||||
if index+end > lenP {
|
||||
i := index
|
||||
if i < 0 {
|
||||
i = 0
|
||||
}
|
||||
if i+end > lenP {
|
||||
end = lenP
|
||||
vc.remainingServerHello -= uint16(end - index)
|
||||
vc.remainingServerHello -= uint16(end - i)
|
||||
} else {
|
||||
vc.remainingServerHello -= uint16(end)
|
||||
end += index
|
||||
end += i
|
||||
}
|
||||
if bytes.Contains(p[index:end], tls13SupportedVersions) {
|
||||
if bytes.Contains(p[i:end], tls13SupportedVersions) {
|
||||
// TLS 1.3 Client Hello
|
||||
cs, ok := tls13CipherSuiteMap[vc.cipher]
|
||||
if ok && cs != "TLS_AES_128_CCM_8_SHA256" {
|
||||
|
Loading…
Reference in New Issue
Block a user