From 1e2c7a7bb387393a6101372764bb9d5fb1c104d4 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 18 Dec 2008 12:27:54 -0500 Subject: [PATCH] BUG: Fix crash when running internal CTest When CTest encounters a test whose executable is the ctest executable iteslf, it just invokes code inside itself to avoid starting a new process. This fixes a null-pointer dereference in the logging code of that case. --- Source/cmCTest.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 629282be7..78b11cf2b 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1154,7 +1154,7 @@ int cmCTest::RunTest(std::vector argv, args.push_back(argv[i]); } } - if ( *log ) + if ( log ) { *log << "* Run internal CTest" << std::endl; } @@ -1166,7 +1166,7 @@ int cmCTest::RunTest(std::vector argv, } *retVal = inst.Run(args, output); - if ( *log ) + if ( log ) { *log << output->c_str(); }