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-Tag: v2.11.0-rc1~19 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a1a9f823d124be389a2d50aaf29b50ff8cc793dd;p=lttng-tools.git 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 bc3b49b71..2c571c4a8 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -2502,7 +2502,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 {