From 6ab87555ea483601cb1829f3b6e9d3d77d6746ff Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Tue, 24 Feb 2004 18:48:44 -0500 Subject: ERR: Fix crash. We should check output before appending to it --- Source/cmSystemTools.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index edb88b5..267dbd3 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -483,7 +483,10 @@ bool cmSystemTools::RunSingleCommand( { std::cerr << exception_str << std::endl; } - output->append(exception_str, strlen(exception_str)); + if ( output ) + { + output->append(exception_str, strlen(exception_str)); + } result = false; } else if(cmsysProcess_GetState(cp) == cmsysProcess_State_Error) @@ -493,7 +496,10 @@ bool cmSystemTools::RunSingleCommand( { std::cerr << error_str << std::endl; } - output->append(error_str, strlen(error_str)); + if ( output ) + { + output->append(error_str, strlen(error_str)); + } result = false; } else if(cmsysProcess_GetState(cp) == cmsysProcess_State_Expired) @@ -503,7 +509,10 @@ bool cmSystemTools::RunSingleCommand( { std::cerr << error_str << std::endl; } - output->append(error_str, strlen(error_str)); + if ( output ) + { + output->append(error_str, strlen(error_str)); + } result = false; } -- cgit v0.12