From bc2bcc383c70b293bd816c29523a952ca8736fb5 Mon Sep 17 00:00:00 2001 From: Sam Liddicott Date: Tue, 7 Jan 2014 09:21:53 -0800 Subject: [PATCH] xt_quota2: remove trailing junk which might have a digit in it Signed-off-by: Sam Liddicott --- extensions/xt_quota2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/xt_quota2.c b/extensions/xt_quota2.c index aa00207..52c88a1 100644 --- a/extensions/xt_quota2.c +++ b/extensions/xt_quota2.c @@ -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);