From de2047c5124f4301931587cb4af79ebe4f5d2f02 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 6 Jul 2009 16:20:46 -0700 Subject: [PATCH] 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. --- vswitchd/bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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")); } -- 2.20.1