Browse Source

deep clone slice with copy

pull/15/head
Jason 5 years ago
parent
commit
b74dd54a5c
  1. 3
      proxy/socks/socks.go

3
proxy/socks/socks.go

@ -232,7 +232,8 @@ func DecodeUDPPacket(packet []byte) (addr Addr, payload []byte, err error) {
err = errors.New("failed to read UDP header")
}
payload = bytes.Join([][]byte{packet[3+len(addr):]}, []byte{})
payload = make([]byte, len(packet[3+len(addr):]))
copy(payload, packet[3+len(addr):])
return
}

Loading…
Cancel
Save