summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTetsuo NAKAGAWA <nakagawa@mxc.nes.nec.co.jp>2010-01-04 18:19:47 -0800
committerJustin Pettit <jpettit@nicira.com>2010-01-04 18:19:47 -0800
commit84f7e9b6d0f8730f4b470ffdc339b0e66dcd958e (patch)
tree0dadf688ac68073d5fa80a08722823ab7c61e5d0
parente9fec732de89569a5fd51325dc9c60520d3e28a3 (diff)
downloadopenvswitch-84f7e9b6d0f8730f4b470ffdc339b0e66dcd958e.tar.gz
ofproto: Fix segfault when changing command execution settings
If the remote command execution settings are changed and a NULL argument is given for the directory, a crash would occur. With this change, the default directory is used.
-rw-r--r--ofproto/executer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ofproto/executer.c b/ofproto/executer.c
index bc42ccf86..b78b0df09 100644
--- a/ofproto/executer.c
+++ b/ofproto/executer.c
@@ -508,5 +508,7 @@ executer_set_acl(struct executer *e, const char *acl, const char *dir)
free(e->command_acl);
e->command_acl = xstrdup(acl);
free(e->command_dir);
- e->command_dir = xstrdup(dir);
+ e->command_dir = (dir
+ ? xstrdup(dir)
+ : xasprintf("%s/commands", ovs_pkgdatadir));
}