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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
563d34d057
commit
5b3e7e6cb5
@@ -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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user