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-30 08:54:13


#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 viboes):

 Replying to [comment:2 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.

 Oh I see. Please could you try just removing the overriding of the what()
 function?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8337#comment:3>
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