Re: [PATCH nft] parser_json: fix segfault in translating string to nft object

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

 



Laura Garcia Liebana <nevola@xxxxxxxxx> wrote:
> The obj_tbl array is allocated with the maximum element index even
> if lower indexes are not populated, so it produces null pointer
> items.
> 
> This patch ensures that the maximum number of possible indexes
> but also the element is not comparing a null pointer.

Applied, thanks Laura.

>  static int string_to_nft_object(const char *str)
>  {
> -	const char *obj_tbl[] = {
> +	const char *obj_tbl[__NFT_OBJECT_MAX] = {
>  		[NFT_OBJECT_COUNTER] = "counter",
>  		[NFT_OBJECT_QUOTA] = "quota",
>  		[NFT_OBJECT_CT_HELPER] = "ct helper",
>  		[NFT_OBJECT_LIMIT] = "limit",
>  		[NFT_OBJECT_SECMARK] = "secmark",
>  	};

Phil, does this need updating?

It looks to me as if this should also init NFT_OBJECT_CT_TIMEOUT and so on.



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux