From c51876c3af8fb5ceb750cdde2b836083166e35e7 Mon Sep 17 00:00:00 2001 From: Alex Wang Date: Fri, 18 Oct 2013 17:27:51 -0700 Subject: odp-execute: Fix possible segfault. In current code, the odp_execute_actions() function does not check the value of "userspace" function pointer before invoking it. This patch adds a check for it. Signed-off-by: Alex Wang Signed-off-by: Ben Pfaff --- lib/odp-execute.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/odp-execute.c') diff --git a/lib/odp-execute.c b/lib/odp-execute.c index 185cf319..19fcc1c1 100644 --- a/lib/odp-execute.c +++ b/lib/odp-execute.c @@ -200,7 +200,9 @@ odp_execute_actions(void *dp, struct ofpbuf *packet, struct flow *key, break; case OVS_ACTION_ATTR_USERSPACE: { - userspace(dp, packet, key, a); + if (userspace) { + userspace(dp, packet, key, a); + } break; } -- cgit v1.2.3