From eeeb88a1ed00eb8c5ba05383fc3dac778c81567a Mon Sep 17 00:00:00 2001 From: Petro Karashchenko Date: Sat, 12 Nov 2022 01:25:41 +0200 Subject: [PATCH] tools: fix NULL pointer dereference in configure.c Signed-off-by: Petro Karashchenko --- tools/configure.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/configure.c b/tools/configure.c index aa6d523164..ccdb096eae 100644 --- a/tools/configure.c +++ b/tools/configure.c @@ -800,7 +800,7 @@ static void enumerate_configs(void) static void check_configdir(void) { - if (verify_optiondir(g_configpath)) + if (g_configpath && verify_optiondir(g_configpath)) { /* Get the path to the custom board scripts directory */ @@ -849,7 +849,7 @@ static void check_configdir(void) snprintf(g_buffer, BUFFER_SIZE, "%s%cboards%c%s%c%s%c%s%cscripts", g_topdir, g_delim, g_delim, g_archdir, g_delim, g_chipdir, g_delim, g_boarddir, g_delim); - debug("check_configdir: Checking scriptspath=%s\n", g_buffer); + debug("check_configdir: Checking scripts path=%s\n", g_buffer); g_scriptspath = NULL; if (verify_optiondir(g_buffer))