mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-03 07:37:34 -04:00
windows, unix: fix wrong unsafe.Pointer alignment in syscall
Same as CL 201877 did for package syscall. Updates golang/go#34972 Change-Id: I3929841ab32378516edafb1f02a84b1bdcc77bbd Reviewed-on: https://go-review.googlesource.com/c/sys/+/202177 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
727590c500
commit
9984515f05
@@ -884,7 +884,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
|
||||
for n < len(pp.Path) && pp.Path[n] != 0 {
|
||||
n++
|
||||
}
|
||||
bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
|
||||
bytes := (*[len(pp.Path)]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
|
||||
sa.Name = string(bytes)
|
||||
return sa, nil
|
||||
|
||||
|
||||
Reference in New Issue
Block a user