[ovs-dev] [PATCH 1/3] ofproto: Fix segfault when changing command execution settings

Justin Pettit jpettit at nicira.com
Tue Jan 5 05:41:45 UTC 2010


From: Tetsuo NAKAGAWA <nakagawa at mxc.nes.nec.co.jp>

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.
---
 ofproto/executer.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/ofproto/executer.c b/ofproto/executer.c
index bc42ccf..b78b0df 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));
 }
-- 
1.6.5.5





More information about the dev mailing list