Re: [PATCH libnftnl 1/2] object: don't set NFTNL_OBJ_TYPE unless obj->ops is non-null

2017-02-27 Thread Pablo Neira Ayuso
On Mon, Feb 27, 2017 at 03:56:09PM +0100, Florian Westphal wrote: > If nft sets an invalid type, nftnl_obj_ops_lookup will return NULL. > In this case we must not set NFTNL_OBJ_TYPE flag, else we later get > crash in nftnl_obj_nlmsg_build_payload as it dereferences obj->ops. > > Signed-off-by: Flo

[PATCH libnftnl 1/2] object: don't set NFTNL_OBJ_TYPE unless obj->ops is non-null

2017-02-27 Thread Florian Westphal
If nft sets an invalid type, nftnl_obj_ops_lookup will return NULL. In this case we must not set NFTNL_OBJ_TYPE flag, else we later get crash in nftnl_obj_nlmsg_build_payload as it dereferences obj->ops. Signed-off-by: Florian Westphal --- src/object.c | 5 - 1 file changed, 4 insertions(+),