mirror of
https://github.com/cedar2025/hysteria.git
synced 2025-06-09 05:59:54 +00:00
fix: tweak
This commit is contained in:
parent
d513ae115b
commit
131306b72b
@ -212,8 +212,9 @@ func ParseUDPMessage(msg []byte) (*UDPMessage, error) {
|
||||
return nil, errors.ProtocolError{Message: "invalid address length"}
|
||||
}
|
||||
bs := buf.Bytes()
|
||||
if len(bs) < int(lAddr) {
|
||||
return nil, errors.ProtocolError{Message: "message length mismatch"}
|
||||
if len(bs) <= int(lAddr) {
|
||||
// We use <= instead of < here as we expect at least one byte of data after the address
|
||||
return nil, errors.ProtocolError{Message: "invalid message length"}
|
||||
}
|
||||
m.Addr = string(bs[:lAddr])
|
||||
m.Data = bs[lAddr:]
|
||||
|
Loading…
x
Reference in New Issue
Block a user