mirror of
https://github.com/golang/sys.git
synced 2026-02-08 19:56:04 +03:00
use path len for array allocation
This commit is contained in:
committed by
Tobias Klauser
parent
ff07ba7068
commit
9b6895a08d
@@ -235,7 +235,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
|
||||
}
|
||||
}
|
||||
|
||||
bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n: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