diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-09-27 15:18:09 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-09-27 15:18:09 -0700 |
commit | 8539abc0df3f4b092f83c856be1d04387e5158cc (patch) | |
tree | 8ad468c5e7d72a5c3348cae9181125e12ed0a290 /pkg/sentry/syscalls | |
parent | abbee5615f4480d8a41b4cf63839d2ab13b19abf (diff) | |
parent | 223481e92743f305ada22689f4ba41b36119d5fc (diff) |
Merge pull request #864 from tanjianfeng:fix-861
PiperOrigin-RevId: 271649711
Diffstat (limited to 'pkg/sentry/syscalls')
-rw-r--r-- | pkg/sentry/syscalls/linux/sys_utsname.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/sentry/syscalls/linux/sys_utsname.go b/pkg/sentry/syscalls/linux/sys_utsname.go index 271ace08e..748e8dd8d 100644 --- a/pkg/sentry/syscalls/linux/sys_utsname.go +++ b/pkg/sentry/syscalls/linux/sys_utsname.go @@ -79,11 +79,11 @@ func Sethostname(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.S return 0, nil, syserror.EINVAL } - name, err := t.CopyInString(nameAddr, int(size)) - if err != nil { + name := make([]byte, size) + if _, err := t.CopyInBytes(nameAddr, name); err != nil { return 0, nil, err } - utsns.SetHostName(name) + utsns.SetHostName(string(name)) return 0, nil, nil } |