diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-05-18 08:28:02 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2006-06-20 05:25:24 -0400 |
commit | e0182909297da8d38a5d473ae7bee3d0324632a1 (patch) | |
tree | 0c5c06bac1d626ba66aba1142f439b0f34c75282 /fs/proc/base.c | |
parent | ac03221a4fdda9bfdabf99bcd129847f20fc1d80 (diff) |
[PATCH] proc_loginuid_write() uses simple_strtoul() on non-terminated array
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 6cc77dc3f3ff..6afff725a8c9 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1019,8 +1019,8 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf, | |||
1019 | if (current != task) | 1019 | if (current != task) |
1020 | return -EPERM; | 1020 | return -EPERM; |
1021 | 1021 | ||
1022 | if (count > PAGE_SIZE) | 1022 | if (count >= PAGE_SIZE) |
1023 | count = PAGE_SIZE; | 1023 | count = PAGE_SIZE - 1; |
1024 | 1024 | ||
1025 | if (*ppos != 0) { | 1025 | if (*ppos != 0) { |
1026 | /* No partial writes. */ | 1026 | /* No partial writes. */ |
@@ -1033,6 +1033,7 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf, | |||
1033 | if (copy_from_user(page, buf, count)) | 1033 | if (copy_from_user(page, buf, count)) |
1034 | goto out_free_page; | 1034 | goto out_free_page; |
1035 | 1035 | ||
1036 | page[count] = '\0'; | ||
1036 | loginuid = simple_strtoul(page, &tmp, 10); | 1037 | loginuid = simple_strtoul(page, &tmp, 10); |
1037 | if (tmp == page) { | 1038 | if (tmp == page) { |
1038 | length = -EINVAL; | 1039 | length = -EINVAL; |