Re: [Boost-bugs] [Boost C++ Libraries] #8337: The internal representation of "std::string(this->code()->message())" escapes, but is destroyed when it exits scope.

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8337: The internal representation of "std::string(this->code()->message())" escapes, but is destroyed when it exits scope.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-03-29 04:03:38


#8337: The internal representation of "std::string(this->code()->message())"
escapes, but is destroyed when it exits scope.
----------------------------------------------+-----------------------------
  Reporter: Richard <legalize@…> | Owner: viboes
      Type: Bugs | Status: assigned
 Milestone: To Be Determined | Component: thread
   Version: Boost 1.52.0 | Severity: Problem
Resolution: | Keywords:
----------------------------------------------+-----------------------------

Comment (by steven_watanabe):

 boost::system::error_code::message returns a temporary string, which is
 destroyed when the function returns. The pointer returned by what() is
 dangling.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8337#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC