mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-30 13:56:45 -04:00
unix: avoid "just past the end" pointers in UnixRights
Same as CL 201617 did for package syscall. Caught with -d=checkptr Updates golang/go#22218 Change-Id: I8208f8e6d9bd62376bf9e0458dc18956daabd785 Reviewed-on: https://go-review.googlesource.com/c/sys/+/201937 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
committed by
Tobias Klauser
parent
b09406accb
commit
727590c500
@@ -17,7 +17,7 @@ func UnixCredentials(ucred *Ucred) []byte {
|
||||
h.Level = SOL_SOCKET
|
||||
h.Type = SCM_CREDENTIALS
|
||||
h.SetLen(CmsgLen(SizeofUcred))
|
||||
*((*Ucred)(cmsgData(h))) = *ucred
|
||||
*(*Ucred)(h.data(0)) = *ucred
|
||||
return b
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user