From 9b6895a08d4d92fff16913c3d7b9495fecb741a1 Mon Sep 17 00:00:00 2001 From: Yaroslav Vorobiov Date: Sat, 28 Mar 2020 15:12:57 +0200 Subject: [PATCH] use path len for array allocation --- unix/syscall_aix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/syscall_aix.go b/unix/syscall_aix.go index a972e682..4b3dabd5 100644 --- a/unix/syscall_aix.go +++ b/unix/syscall_aix.go @@ -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