xt_quota2: remove trailing junk which might have a digit in it

Cherry-pick commit v2.3-6-gbc2bcc3.

Signed-off-by: Sam Liddicott <sam@liddicott.com>
This commit is contained in:
Sam Liddicott
2014-01-07 09:21:53 -08:00
committed by Jan Engelhardt
parent 7fcbbe7dee
commit a2d22c427f

View File

@@ -69,6 +69,8 @@ static int quota_proc_write(struct file *file, const char __user *input,
if (copy_from_user(buf, input, size) != 0)
return -EFAULT;
buf[sizeof(buf)-1] = '\0';
if (size < sizeof(buf))
buf[size] = '\0';
spin_lock_bh(&e->lock);
e->quota = simple_strtoull(buf, NULL, 0);