From 0e09c7cdf072745bc097f54e30a0e49a8d8f60f9 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Thu, 18 May 2006 08:28:02 -0400 Subject: [PATCH] --- yaml --- r: 28029 b: refs/heads/master c: e0182909297da8d38a5d473ae7bee3d0324632a1 h: refs/heads/master i: 28027: 80a706dd53ab3a215c86b06a790ce245f1755e8d v: v3 --- [refs] | 2 +- trunk/fs/proc/base.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 50ddaa2126a4..57fee2f3d4d2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ac03221a4fdda9bfdabf99bcd129847f20fc1d80 +refs/heads/master: e0182909297da8d38a5d473ae7bee3d0324632a1 diff --git a/trunk/fs/proc/base.c b/trunk/fs/proc/base.c index 6cc77dc3f3ff..6afff725a8c9 100644 --- a/trunk/fs/proc/base.c +++ b/trunk/fs/proc/base.c @@ -1019,8 +1019,8 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf, if (current != task) return -EPERM; - if (count > PAGE_SIZE) - count = PAGE_SIZE; + if (count >= PAGE_SIZE) + count = PAGE_SIZE - 1; if (*ppos != 0) { /* No partial writes. */ @@ -1033,6 +1033,7 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf, if (copy_from_user(page, buf, count)) goto out_free_page; + page[count] = '\0'; loginuid = simple_strtoul(page, &tmp, 10); if (tmp == page) { length = -EINVAL;