]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
xt_quota2: remove trailing junk which might have a digit in it
authorSam Liddicott <sam@liddicott.com>
Tue, 7 Jan 2014 17:21:53 +0000 (09:21 -0800)
committerJan Engelhardt <jengelh@inai.de>
Thu, 9 Jan 2014 09:00:43 +0000 (10:00 +0100)
Signed-off-by: Sam Liddicott <sam@liddicott.com>
extensions/xt_quota2.c

index aa00207b19be9f5cfcac152692f343301c423931..52c88a18318415f2b8eb70d6fd58d39699a2c654 100644 (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);