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:49:37 +08:00
parent 8a43e379a5
commit 2fbf20c9e4
2 changed files with 2 additions and 1 deletions

1
.gitignore vendored
View File

@@ -16,3 +16,4 @@
.DS_Store
config.yaml
WireGold

View File

@@ -155,7 +155,7 @@ func (p PacketID) issame(packet []byte) bool {
func (m *Me) sendAllSameDst(packet []byte) (n int, rem []byte) {
rem = packet
if !waterutil.IsIPv4(packet) {
for waterutil.IsIPv6(rem) {
for len(rem) > 20 && waterutil.IsIPv6(rem) {
pktl := int(binary.BigEndian.Uint16(packet[4:6])) + 40
if pktl > len(rem) {
return