ENH: put checks on vector before referencing begin iterator
This commit is contained in:
parent
f67f158344
commit
434d2292c5
|
@ -200,14 +200,19 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix,
|
||||||
cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: "
|
cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: "
|
||||||
<< error_buffer << std::endl);
|
<< error_buffer << std::endl);
|
||||||
*this->LogFile << " Error when uploading file: "
|
*this->LogFile << " Error when uploading file: "
|
||||||
<< local_file.c_str()
|
<< local_file.c_str()
|
||||||
<< std::endl
|
<< std::endl
|
||||||
<< " Error message was: " << error_buffer << std::endl
|
<< " Error message was: " << error_buffer << std::endl
|
||||||
<< " Curl output was: "
|
<< " Curl output was: ";
|
||||||
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << std::endl;
|
// avoid dereference of empty vector
|
||||||
cmCTestLog(this->CTest, ERROR_MESSAGE, "CURL output: ["
|
if(chunk.size())
|
||||||
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
|
{
|
||||||
<< std::endl);
|
*this->LogFile << cmCTestLogWrite(&*chunk.begin(), chunk.size());
|
||||||
|
cmCTestLog(this->CTest, ERROR_MESSAGE, "CURL output: ["
|
||||||
|
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
|
||||||
|
<< std::endl);
|
||||||
|
}
|
||||||
|
*this->LogFile << std::endl;
|
||||||
::curl_easy_cleanup(curl);
|
::curl_easy_cleanup(curl);
|
||||||
::curl_global_cleanup();
|
::curl_global_cleanup();
|
||||||
return false;
|
return false;
|
||||||
|
@ -379,14 +384,20 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
|
||||||
cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: "
|
cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: "
|
||||||
<< error_buffer << std::endl);
|
<< error_buffer << std::endl);
|
||||||
*this->LogFile << " Error when uploading file: "
|
*this->LogFile << " Error when uploading file: "
|
||||||
<< local_file.c_str()
|
<< local_file.c_str()
|
||||||
<< std::endl
|
<< std::endl
|
||||||
<< " Error message was: " << error_buffer << std::endl
|
<< " Error message was: " << error_buffer
|
||||||
<< " Curl output was: "
|
<< std::endl;
|
||||||
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << std::endl;
|
// avoid deref of begin for zero size array
|
||||||
cmCTestLog(this->CTest, ERROR_MESSAGE, "CURL output: ["
|
if(chunk.size())
|
||||||
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
|
{
|
||||||
<< std::endl);
|
*this->LogFile << " Curl output was: "
|
||||||
|
<< cmCTestLogWrite(&*chunk.begin(), chunk.size())
|
||||||
|
<< std::endl;
|
||||||
|
cmCTestLog(this->CTest, ERROR_MESSAGE, "CURL output: ["
|
||||||
|
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
|
||||||
|
<< std::endl);
|
||||||
|
}
|
||||||
::curl_easy_cleanup(curl);
|
::curl_easy_cleanup(curl);
|
||||||
::curl_global_cleanup();
|
::curl_global_cleanup();
|
||||||
return false;
|
return false;
|
||||||
|
@ -499,13 +510,18 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
|
||||||
cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: "
|
cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: "
|
||||||
<< error_buffer << std::endl);
|
<< error_buffer << std::endl);
|
||||||
*this->LogFile << "\tTrigerring failed with error: " << error_buffer
|
*this->LogFile << "\tTrigerring failed with error: " << error_buffer
|
||||||
<< std::endl
|
<< std::endl
|
||||||
<< " Error message was: " << error_buffer << std::endl
|
<< " Error message was: " << error_buffer
|
||||||
<< " Curl output was: "
|
<< std::endl;
|
||||||
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << std::endl;
|
if(chunk.size())
|
||||||
cmCTestLog(this->CTest, ERROR_MESSAGE, "CURL output: ["
|
{
|
||||||
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
|
*this->LogFile
|
||||||
<< std::endl);
|
<< " Curl output was: "
|
||||||
|
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << std::endl;
|
||||||
|
cmCTestLog(this->CTest, ERROR_MESSAGE, "CURL output: ["
|
||||||
|
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
|
||||||
|
<< std::endl);
|
||||||
|
}
|
||||||
::curl_easy_cleanup(curl);
|
::curl_easy_cleanup(curl);
|
||||||
::curl_global_cleanup();
|
::curl_global_cleanup();
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue