From 0df3c162fba0233030674f76162fb0131dbddcc5 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 17 Nov 2005 15:44:43 -0500 Subject: [PATCH] BUG: Do not dereference an end iterator. --- Source/cmCTest.cxx | 2 +- Source/cmSystemTools.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index e9e84b513..1e079b923 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1070,7 +1070,7 @@ int cmCTest::RunTest(std::vector argv, } cmsysProcess_WaitForExit(cp, 0); - if(output) + if(output && tempOutput.begin() != tempOutput.end()) { output->append(&*tempOutput.begin(), tempOutput.size()); } diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 0621ba22b..623a0f917 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -507,7 +507,7 @@ bool cmSystemTools::RunSingleCommand( } cmsysProcess_WaitForExit(cp, 0); - if ( output ) + if ( output && tempOutput.begin() != tempOutput.end()) { output->append(&*tempOutput.begin(), tempOutput.size()); }