From 092209fa848996840216ce6ad5cb8d7541cd6e40 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 30 Jan 2023 09:43:38 +0200 Subject: [PATCH] CMake: Fix potential null deref Reported by Coverity. Looks like it cannot really happen in real life though. Change-Id: I92e09dbe7dc81e694e5450c598c649c956eb7fcc Reviewed-by: hjk Reviewed-by: Cristian Adam --- src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 9b834bc6263..d1cca77c0bf 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -747,8 +747,8 @@ void CMakeBuildSystem::handleParsingSucceeded(bool restoredFromBackup) checkAndReportError(errorMessage); } - const CMakeTool *tool = m_parameters.cmakeTool(); - m_ctestPath = tool->cmakeExecutable().withNewPath(m_reader.ctestPath()); + if (const CMakeTool *tool = m_parameters.cmakeTool()) + m_ctestPath = tool->cmakeExecutable().withNewPath(m_reader.ctestPath()); setApplicationTargets(appTargets()); setDeploymentData(deploymentData());