mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-15 22:50:24 +08:00
fix out of bound
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -16,3 +16,4 @@
|
|||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
config.yaml
|
config.yaml
|
||||||
|
WireGold
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ func (p PacketID) issame(packet []byte) bool {
|
|||||||
func (m *Me) sendAllSameDst(packet []byte) (n int, rem []byte) {
|
func (m *Me) sendAllSameDst(packet []byte) (n int, rem []byte) {
|
||||||
rem = packet
|
rem = packet
|
||||||
if !waterutil.IsIPv4(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
|
pktl := int(binary.BigEndian.Uint16(packet[4:6])) + 40
|
||||||
if pktl > len(rem) {
|
if pktl > len(rem) {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user