diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-02-24 23:48:44 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-02-24 23:48:44 (GMT) |
commit | 6ab87555ea483601cb1829f3b6e9d3d77d6746ff (patch) | |
tree | 19541b5bbe5b3cfa24b877600c72771dcd816231 | |
parent | 3c832dd1b8ae13edccadfc1487448b986d989560 (diff) | |
download | CMake-6ab87555ea483601cb1829f3b6e9d3d77d6746ff.zip CMake-6ab87555ea483601cb1829f3b6e9d3d77d6746ff.tar.gz CMake-6ab87555ea483601cb1829f3b6e9d3d77d6746ff.tar.bz2 |
ERR: Fix crash. We should check output before appending to it
-rw-r--r-- | Source/cmSystemTools.cxx | 15 |
1 files 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; } |