mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-18 00:40:25 +08:00
fix out of bound
This commit is contained in:
@@ -163,7 +163,7 @@ func (m *Me) sendAllSameDst(packet []byte) (n int, rem []byte) {
|
|||||||
n += pktl
|
n += pktl
|
||||||
rem = packet[n:]
|
rem = packet[n:]
|
||||||
}
|
}
|
||||||
if !waterutil.IsIPv4(rem) {
|
if len(rem) == 0 || !waterutil.IsIPv4(rem) {
|
||||||
logrus.Warnln("[me] skip to send", len(rem), "bytes non-ipv4/v6 packet")
|
logrus.Warnln("[me] skip to send", len(rem), "bytes non-ipv4/v6 packet")
|
||||||
return len(packet), nil
|
return len(packet), nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user