mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 04:17:57 +01:00
Problem: sub.xsetsockopt leaks message (0..n bytes) payload on fail.
This commit is contained in:
@@ -69,15 +69,8 @@ int zmq::sub_t::xsetsockopt (int option_, const void *optval_,
|
|||||||
memcpy (data + 1, optval_, optvallen_);
|
memcpy (data + 1, optval_, optvallen_);
|
||||||
}
|
}
|
||||||
// Pass it further on in the stack.
|
// Pass it further on in the stack.
|
||||||
int err = 0;
|
|
||||||
rc = xsub_t::xsend (&msg);
|
rc = xsub_t::xsend (&msg);
|
||||||
if (rc != 0)
|
return close_and_return (&msg, rc);
|
||||||
err = errno;
|
|
||||||
int rc2 = msg.close ();
|
|
||||||
errno_assert (rc2 == 0);
|
|
||||||
if (rc != 0)
|
|
||||||
errno = err;
|
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int zmq::sub_t::xsend (msg_t *)
|
int zmq::sub_t::xsend (msg_t *)
|
||||||
|
|||||||
Reference in New Issue
Block a user