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);