Problem: Use of pipe_t after free in zmq::socket_base_t::term_endpoint(). Issue #3245.

Solution: When pipe_t is freed (terminated) remove it from _endpoints member of zmq::socket_base_t. Resolves issue #3245.
This commit is contained in:
Bunjevacki, Jovan
2018-10-30 13:33:14 +01:00
parent 3863c869cc
commit f5d1d5d1af
3 changed files with 34 additions and 0 deletions

View File

@@ -141,6 +141,9 @@ class pipe_t : public object_t,
// Returns true if HWM is not reached
bool check_hwm () const;
void set_endpoint_uri (const char *name_);
std::string &get_endpoint_uri ();
private:
// Type of the underlying lock-free pipe.
typedef ypipe_base_t<msg_t> upipe_t;
@@ -244,6 +247,10 @@ class pipe_t : public object_t,
const bool _conflate;
// If the pipe belongs to socket's endpoint the endpoint's name is stored here.
// Otherwise this is empty.
std::string _endpoint_uri;
// Disable copying.
pipe_t (const pipe_t &);
const pipe_t &operator= (const pipe_t &);