From: Tetsuo NAKAGAWA Date: Tue, 5 Jan 2010 02:19:47 +0000 (-0800) Subject: ofproto: Fix segfault when changing command execution settings X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84f7e9b6d0f8730f4b470ffdc339b0e66dcd958e;p=openvswitch 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. --- diff --git a/ofproto/executer.c b/ofproto/executer.c index bc42ccf8..b78b0df0 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)); }