You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling .To4 on an IPv6 IP, returns a slice of the IPv4 part of the address. Elsewhere new buffers are allocated instead, and it's natural to assume this is the case for To4 as well. User code can proceed assuming it now owns the contents of net.IP which is not correct.
To4 converts the IPv4 address ip to a 4-byte representation. If ip is not an IPv4 address, To4 returns nil. There is no guarantee the returned IP is freshly allocated.
?
The text was updated successfully, but these errors were encountered:
Calling .To4 on an IPv6 IP, returns a slice of the IPv4 part of the address. Elsewhere new buffers are allocated instead, and it's natural to assume this is the case for To4 as well. User code can proceed assuming it now owns the contents of net.IP which is not correct.
To4 converts the IPv4 address ip to a 4-byte representation. If ip is not an IPv4 address, To4 returns nil. There is no guarantee the returned IP is freshly allocated.
?
The text was updated successfully, but these errors were encountered: