Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114722
b: refs/heads/master
c: 8798881
h: refs/heads/master
v: v3
  • Loading branch information
Vegard Nossum authored and Linus Torvalds committed Oct 16, 2008
1 parent 9d72b42 commit bfe5a07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 929f37cb3c3e0f4d23d7106693b7067cf72f4dbc
refs/heads/master: 87988815073918134c0dae059cf247a4472d78ed
6 changes: 4 additions & 2 deletions trunk/kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,8 @@ asmlinkage long sys_sethostname(char __user *name, int len)
errno = -EFAULT;
if (!copy_from_user(tmp, name, len)) {
memcpy(utsname()->nodename, tmp, len);
utsname()->nodename[len] = 0;
memset(utsname()->nodename + len, 0,
sizeof(utsname()->nodename) - len);
errno = 0;
}
up_write(&uts_sem);
Expand Down Expand Up @@ -1396,7 +1397,8 @@ asmlinkage long sys_setdomainname(char __user *name, int len)
errno = -EFAULT;
if (!copy_from_user(tmp, name, len)) {
memcpy(utsname()->domainname, tmp, len);
utsname()->domainname[len] = 0;
memset(utsname()->domainname + len, 0,
sizeof(utsname()->domainname) - len);
errno = 0;
}
up_write(&uts_sem);
Expand Down

0 comments on commit bfe5a07

Please sign in to comment.