Re: [PATCH v2, libnftnl] Fix nftnl_*_get to set data_len

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

 



On Mon, Jul 11, 2016 at 01:41:07PM +0200, Carlos Falgueras García wrote:
> diff --git a/src/expr/lookup.c b/src/expr/lookup.c
> index 7f68f74..a29b7e5 100644
> --- a/src/expr/lookup.c
> +++ b/src/expr/lookup.c
> @@ -73,10 +73,13 @@ nftnl_expr_lookup_get(const struct nftnl_expr *e, uint16_t type,
>  		*data_len = sizeof(lookup->dreg);
>  		return &lookup->dreg;
>  	case NFTNL_EXPR_LOOKUP_SET:
> +		*data_len = strlen(lookup->set_name) + 1;
>  		return lookup->set_name;
>  	case NFTNL_EXPR_LOOKUP_SET_ID:
> +		*data_len = sizeof(lookup->set_id) + 1;
>  		return &lookup->set_id;
>  	case NFTNL_EXPR_LOOKUP_FLAGS:
> +		*data_len = sizeof(lookup->flags) + 1;

This + 1 here doesn't make any sense.

Please, send v3 without all these + 1.

And as I said in the previous version, you have to return strlen() as is.
--
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