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

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 c6c70ab30b
commit bc2bcc383c

View File

@@ -76,6 +76,8 @@ 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);