mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-12 05:37:32 +00:00
all: use Go 1.20's bytes.Clone
Updates #7123 Updates #6257 (more to do in other repos) Change-Id: I073e2a6d81a5d7fbecc29caddb7e057ff65239d0 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
f7b3156f16
commit
cf8dd7aa09
@@ -5,6 +5,7 @@
|
||||
package stun
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
crand "crypto/rand"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
@@ -300,7 +301,7 @@ func mappedAddress(b []byte) (addr []byte, port uint16, err error) {
|
||||
if len(addrField) < addrLen {
|
||||
return nil, 0, ErrMalformedAttrs
|
||||
}
|
||||
return append([]byte(nil), addrField[:addrLen]...), port, nil
|
||||
return bytes.Clone(addrField[:addrLen]), port, nil
|
||||
}
|
||||
|
||||
// Is reports whether b is a STUN message.
|
||||
|
Reference in New Issue
Block a user