execute_odp_actions() can be passed a zero-length set of actions, in which
case it may not dereference its 'odp_actions' parameter at all, but in fact
it did do so. In at least one corner case, odp_actions can be NULL, so
that this caused a segfault.
Introduced in commit
98403001ec "datapath: Move Netlink PID for userspace
actions from flows to actions."
Reported-by: Pravin Shelar <pshelar@nicira.com>
struct ofpbuf key;
int error;
- if (odp_actions->nla_type == OVS_ACTION_ATTR_USERSPACE
- && NLA_ALIGN(odp_actions->nla_len) == actions_len) {
+ if (actions_len == 0) {
+ return true;
+ } else if (odp_actions->nla_type == OVS_ACTION_ATTR_USERSPACE
+ && NLA_ALIGN(odp_actions->nla_len) == actions_len) {
struct user_action_cookie cookie;
struct dpif_upcall upcall;
uint64_t cookie_u64;