1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-04 23:40:26 +08:00

fix out of bound

This commit is contained in:
fumiama
2022-01-01 17:52:14 +08:00
parent 2fbf20c9e4
commit cdaacdcfed

View File

@@ -163,7 +163,7 @@ func (m *Me) sendAllSameDst(packet []byte) (n int, rem []byte) {
n += pktl
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")
return len(packet), nil
}