From: Alex Wang Date: Sat, 19 Oct 2013 00:27:51 +0000 (-0700) Subject: odp-execute: Fix possible segfault. X-Git-Tag: sliver-openvswitch-2.0.90-1~7^2~30 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=c51876c3af8fb5ceb750cdde2b836083166e35e7;p=sliver-openvswitch.git 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 --- diff --git a/lib/odp-execute.c b/lib/odp-execute.c index 185cf319c..19fcc1c1a 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; }