From: Jérémie Galarneau Date: Thu, 30 Aug 2018 17:36:37 +0000 (-0400) Subject: Fix: potential use of NULL path in stat() use X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=e8b552f981163a4d4eb831326cd4de8e07dff219 Fix: potential use of NULL path in stat() use Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index f7b3c7c84..fa6fa4830 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -2436,7 +2436,8 @@ static pid_t spawn_consumerd(struct consumer_data *consumer_data) } else if (stat(INSTALL_BIN_PATH "/" DEFAULT_CONSUMERD_FILE, &st) == 0) { DBG3("Found location #2"); consumer_to_use = INSTALL_BIN_PATH "/" DEFAULT_CONSUMERD_FILE; - } else if (stat(config.consumerd32_bin_path.value, &st) == 0) { + } else if (config.consumerd32_bin_path.value && + stat(config.consumerd32_bin_path.value, &st) == 0) { DBG3("Found location #3"); consumer_to_use = config.consumerd32_bin_path.value; } else {