VboxWrapper: prevent use after free in FloppyIOException

see http://blog.sensecodons.com/2013/04/dont-let-stdstringstreamstrcstr-happen.html for details
fixes CID 34536 found by Coverity
This commit is contained in:
Christian Beer 2015-11-10 16:56:44 +01:00
parent 155b35a3a2
commit bbc4cf5751
1 changed files with 2 additions and 1 deletions

View File

@ -170,7 +170,8 @@ namespace FloppyIONS {
virtual const char* what() const throw() {
static std::ostringstream oss (std::ostringstream::out);
oss << this->message << ". Error code = " << this->code;
return oss.str().c_str();
std::string tmp = oss.str();
return tmp.c_str();
}
// Change the message and return my instance