aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Wang <alexw@nicira.com>2013-10-18 17:27:51 -0700
committerBen Pfaff <blp@nicira.com>2013-10-21 15:54:19 -0700
commitc51876c3af8fb5ceb750cdde2b836083166e35e7 (patch)
treee821bd894d87ac974d2d5f2b35e7617927fae918
parenta7a2d006baae4152d338bd0bb4de1687084b1b07 (diff)
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 <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
-rw-r--r--lib/odp-execute.c4
1 files changed, 3 insertions, 1 deletions
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;
}