[ovs-dev] [PATCH] lib/odp: coverity null check in odp_execute_sample

Madhu Challa challa at noironetworks.com
Wed Aug 27 01:00:42 UTC 2014


call odp_execute_actions__ only if there are any subactions to prevent null
pointer dereference in nl_attr_get().

Signed-off-by: Madhu Challa <challa at noironetworks.com>
---
 lib/odp-execute.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/odp-execute.c b/lib/odp-execute.c
index e1e9b57..607af03 100644
--- a/lib/odp-execute.c
+++ b/lib/odp-execute.c
@@ -194,6 +194,9 @@ odp_execute_sample(void *dp, struct dpif_packet
*packet, bool steal,
         }
     }

+    if (subactions == NULL)
+        return;
+
     odp_execute_actions__(dp, &packet, 1, steal, md,
nl_attr_get(subactions),
                           nl_attr_get_size(subactions), dp_execute_action,
                           more_actions);
--
1.7.9.5



More information about the dev mailing list