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:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -16,3 +16,4 @@
|
||||
|
||||
.DS_Store
|
||||
config.yaml
|
||||
WireGold
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user