use path len for array allocation

This commit is contained in:
Yaroslav Vorobiov
2020-03-28 15:12:57 +02:00
committed by Tobias Klauser
parent ff07ba7068
commit 9b6895a08d

View File

@@ -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