diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2019-10-16 18:02:35 -0700 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2019-10-17 18:42:47 +0000 |
| commit | ef18d6a929438babb59056aef0e485ca65ff8c25 (patch) | |
| tree | 94e5ea22ed2508b4ff804e47fbf0c3295b079e19 /src/syscall/sockcmsg_linux.go | |
| parent | 3972f97d049edde37936d8b675e3600d10705dbc (diff) | |
| download | go-ef18d6a929438babb59056aef0e485ca65ff8c25.tar.xz | |
syscall: avoid "just past the end" pointers in UnixRights
Caught with -d=checkptr.
Updates #22218.
Change-Id: Ic0fcff4d2c8d83e4e7f5e0c6d01f03c9c7766c6d
Reviewed-on: https://go-review.googlesource.com/c/go/+/201617
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/syscall/sockcmsg_linux.go')
| -rw-r--r-- | src/syscall/sockcmsg_linux.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/syscall/sockcmsg_linux.go b/src/syscall/sockcmsg_linux.go index 4cb9075ba8..d97667cf7e 100644 --- a/src/syscall/sockcmsg_linux.go +++ b/src/syscall/sockcmsg_linux.go @@ -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 } |
