mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2025-08-02 01:42:54 +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]
|
junkSize := msgTypeToJunkSize[assumedMsgType]
|
||||||
// transport size can align with other header types;
|
// transport size can align with other header types;
|
||||||
// making sure we have the right msgType
|
// 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 {
|
if msgType == assumedMsgType {
|
||||||
packet = packet[junkSize:]
|
packet = packet[junkSize:]
|
||||||
} else {
|
} else {
|
||||||
|
device.log.Verbosef("Transport packet lined up with another msg type")
|
||||||
msgType = binary.LittleEndian.Uint32(packet[:4])
|
msgType = binary.LittleEndian.Uint32(packet[:4])
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue