mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-17 17:48:40 +00:00
QUIC sniffer: Fix potential slice panic
This commit is contained in:
parent
72170d8b6b
commit
1bfc956858
2 changed files with 22 additions and 0 deletions
|
@ -114,6 +114,10 @@ func SniffQUIC(b []byte) (*SniffHeader, error) {
|
|||
if err != nil {
|
||||
return nil, errNotQuic
|
||||
}
|
||||
// packetLen is impossible to be shorter than this
|
||||
if packetLen < 4 {
|
||||
return nil, errNotQuic
|
||||
}
|
||||
|
||||
hdrLen := len(b) - int(buffer.Len())
|
||||
if len(b) < hdrLen+int(packetLen) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue