summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-09-27 22:24:04 +0000
committergVisor bot <gvisor-bot@google.com>2019-09-27 22:24:04 +0000
commita724c7a9b05f12695eefd0f2207061aab87fdf1a (patch)
treed43a1f0b46180d906ad6b548f2f0d7925d55a869 /pkg/sentry
parent8acba6091f7e2b638d3c942269f1fb1feaf09792 (diff)
parent8539abc0df3f4b092f83c856be1d04387e5158cc (diff)
Merge release-20190806.1-203-g8539abc (automated)
Diffstat (limited to 'pkg/sentry')
-rw-r--r--pkg/sentry/syscalls/linux/sys_utsname.go6
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
}