Commit 5b3e7e6c authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

openvswitch: potential NULL deref in sample()

If there is no OVS_SAMPLE_ATTR_ACTIONS set then "acts_list" is NULL and
it leads to a NULL dereference when we call nla_len(acts_list).  This
is a static checker fix, not something I have seen in testing.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 563d34d0
...@@ -325,6 +325,9 @@ static int sample(struct datapath *dp, struct sk_buff *skb, ...@@ -325,6 +325,9 @@ static int sample(struct datapath *dp, struct sk_buff *skb,
} }
} }
if (!acts_list)
return 0;
return do_execute_actions(dp, skb, nla_data(acts_list), return do_execute_actions(dp, skb, nla_data(acts_list),
nla_len(acts_list), true); nla_len(acts_list), true);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment