Re: Patches to xtables-addons xt_quota2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 2014-01-07 19:56, Sam Liddicott wrote:
>[0003]
>@@ -79,9 +80,35 @@ quota_proc_write(struct file *file, const char __user *input,
> 	if (size < sizeof(buf))
> 		buf[size]=0;
> 
>-	spin_lock_bh(&e->lock);
>-	e->quota = simple_strtoull(buf, NULL, 0);
>-	spin_unlock_bh(&e->lock);
>+	while (isspace(*c))
>+		c++;
>+
>+	if (size - (c - buf) < 1) /* min string length */
>+		return c - buf;

Because @input is copied to @buf and that is size-limited, a string like
 "                  +-123"
would be recognizd as -12 rather than -123. So, don't bother with
spaces at all.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux