mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2025-07-30 16:42:50 +02:00
fix out of range crash
This commit is contained in:
parent
dda3a71aec
commit
78b47a89a8
1 changed files with 2 additions and 1 deletions
|
@ -141,10 +141,11 @@ func (device *Device) RoutineReceiveIncoming(
|
|||
junkSize := msgTypeToJunkSize[assumedMsgType]
|
||||
// transport size can align with other header types;
|
||||
// making sure we have the right msgType
|
||||
msgType = binary.LittleEndian.Uint32(packet[junkSize:4])
|
||||
msgType = binary.LittleEndian.Uint32(packet[junkSize:junkSize+4])
|
||||
if msgType == assumedMsgType {
|
||||
packet = packet[junkSize:]
|
||||
} else {
|
||||
device.log.Verbosef("Transport packet lined up with another msg type")
|
||||
msgType = binary.LittleEndian.Uint32(packet[:4])
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue