mirror of
https://github.com/golang/sys.git
synced 2026-01-29 07:02:06 +03:00
unix: fix out of bounds memory access in tests
sockaddrIUCVToAny used the wrong size to for copying to RawSockaddrAny. We found this by running the test with ASAN. Change-Id: I2a2ec28f9bd55aeba4ddcb4243ad61ec010087df Reviewed-on: https://go-review.googlesource.com/c/sys/+/724280 Reviewed-by: Michael Stapelberg <stapelberg@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
committed by
Michael Stapelberg
parent
4f4f1c6fea
commit
08e54827f6
@@ -909,7 +909,7 @@ func sockaddrIUCVToAny(in RawSockaddrIUCV) *RawSockaddrAny {
|
||||
var out RawSockaddrAny
|
||||
copy(
|
||||
(*(*[SizeofSockaddrAny]byte)(unsafe.Pointer(&out)))[:],
|
||||
(*(*[SizeofSockaddrUnix]byte)(unsafe.Pointer(&in)))[:],
|
||||
(*(*[SizeofSockaddrIUCV]byte)(unsafe.Pointer(&in)))[:],
|
||||
)
|
||||
return &out
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user