From: Ben Pfaff Date: Mon, 6 Jul 2009 23:20:46 +0000 (-0700) Subject: vswitch: Don't pass null pointer to stat(). X-Git-Tag: v0.90.3~10 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=de2047c5124f4301931587cb4af79ebe4f5d2f02;p=sliver-openvswitch.git vswitch: Don't pass null pointer to stat(). If no CA certificate is defined then cacert_file is null. The kernel kindly tolerates this but we should not do it anyhow. Found with valgrind. --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index b222152db..cadefeebb 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -345,7 +345,7 @@ bridge_configure_ssl(void) * the old certificate will still be trusted until vSwitch is * restarted. We may want to address this in vconn's SSL library. */ if (config_string_change("ssl.ca-cert", &cacert_file) - || (stat(cacert_file, &s) && errno == ENOENT)) { + || (cacert_file && stat(cacert_file, &s) && errno == ENOENT)) { vconn_ssl_set_ca_cert_file(cacert_file, cfg_get_bool(0, "ssl.bootstrap-ca-cert")); }