Re: [PATCH] xtables: use strspn() to check if string needs to be quoted

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

 



Am 14.02.2011 07:54, schrieb Max Kellermann:
> Problem: the call xtables_save_string("'") prints just a single quote,
> not enclosed in double quoted and not escaped.
> 
> Steps to reproduce:
> 
>  $ iptables -A foo -m comment --comment "'" -j ACCEPT
>  $ iptables-multi save|grep foo
>  -A foo -m comment --comment ' -j ACCEPT
> 
> The cause was the use of strcspn() to locate the first character which
> justified quoting the string in double quotes.  That however was
> wrong, because the way strcspn() was called, it returned a pointer to
> the first character that was not to be escaped, which did the right
> thing most of the time, but not for strings consisting only of quote
> characters.  This patch changes strcspn() to strspn().

Looks good to me, applied. But please remember to sign off your
patches.

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