Re: [PATCH iptables] extensions: libxt_hashlimit: fix 64-bit printf formats

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

 



On 08/04/17 21:29, Pablo Neira Ayuso wrote:
> On Fri, Apr 07, 2017 at 12:47:29PM +0100, James Cowgill wrote:
>> hashlimit was using "%lu" in a lot of printf format specifiers to print
>> 64-bit integers. This is incorrect on 32-bit architectures because
>> "long int" is 32-bits there. On MIPS, it was causing iptables to
>> segfault when printing these integers.
>>
>> Fix by using the correct format specifier.
> 
> One comment below...
> 
>> @@ -262,7 +262,7 @@ static uint64_t parse_burst(const char *burst, int revision)
>>  	if (v > max)
>>  		xtables_error(PARAMETER_PROBLEM, "bad value for option "
>>  			"\"--hashlimit-burst\", value \"%s\" too large "
>> -				"(max %lumb).", burst, max/1024/1024);
>> +				"(max %" PRIu64 "mb).", burst, max/1024/1024);
>                                         ^      ^
> 
> I can remove this whitespaces, right? I'm looking at other spots in
> the iptables code and I would like to keep this consistent.
> 
> No need to resent the patch, I can just mangle this here and apply.

Yes removing the spaces around PRIu64 should be fine.

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