mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-19 21:06:56 +08:00
Fix potential panic
This commit is contained in:
parent
1aabe7ea78
commit
e1d4a04fb4
@ -143,7 +143,9 @@ func SniffQUIC(b []byte) (*SniffHeader, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(b) < hdrLen+4+block.BlockSize() {
|
||||
return nil, errNotQuic
|
||||
}
|
||||
cache.Clear()
|
||||
mask := cache.Extend(int32(block.BlockSize()))
|
||||
block.Encrypt(mask, b[hdrLen+4:hdrLen+4+len(mask)])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user