Re: [libnftnl PATCH] mxml: test if the root node name is initialized before to compare it.

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

 



On Mon, Mar 02, 2015 at 08:58:38PM +0100, Alvaro Neira Ayuso wrote:
> If the root node name is not correctly initialized, we have a crash.

Under what circunstances may tree->value.opaque be NULL?

> ---
>  src/mxml.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mxml.c b/src/mxml.c
> index 0001ba0..b68f86f 100644
> --- a/src/mxml.c
> +++ b/src/mxml.c
> @@ -43,7 +43,8 @@ mxml_node_t *nft_mxml_build_tree(const void *data, const char *treename,
>  		goto err;
>  	}
>  
> -	if (strcmp(tree->value.opaque, treename) == 0)
> +	if (tree->value.opaque != NULL &&
> +	    strcmp(tree->value.opaque, treename) == 0)
>  		return tree;
>  
>  	err->error = NFT_PARSE_EMISSINGNODE;
> -- 
> 1.7.10.4
> 
> --
> 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
--
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