mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-31 14:39:55 +01:00
ZMQII-2: SIGSEGV in zmq_connecter_init_t::read
This commit is contained in:
parent
93e70ee583
commit
f674c9269e
@ -70,7 +70,7 @@ bool zmq::zmq_decoder_t::message_ready ()
|
|||||||
{
|
{
|
||||||
// Message is completely read. Push it further and start reading
|
// Message is completely read. Push it further and start reading
|
||||||
// new message.
|
// new message.
|
||||||
if (!destination->write (&in_progress))
|
if (!destination || !destination->write (&in_progress))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
next_step (tmpbuf, 1, &zmq_decoder_t::one_byte_size_ready);
|
next_step (tmpbuf, 1, &zmq_decoder_t::one_byte_size_ready);
|
||||||
|
@ -54,7 +54,7 @@ bool zmq::zmq_encoder_t::message_ready ()
|
|||||||
// Note that new state is set only if write is successful. That way
|
// Note that new state is set only if write is successful. That way
|
||||||
// unsuccessful write will cause retry on the next state machine
|
// unsuccessful write will cause retry on the next state machine
|
||||||
// invocation.
|
// invocation.
|
||||||
if (!source->read (&in_progress))
|
if (!source || !source->read (&in_progress))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
size_t size = zmq_msg_size (&in_progress);
|
size_t size = zmq_msg_size (&in_progress);
|
||||||
|
@ -66,6 +66,8 @@ void zmq::zmq_engine_t::plug (i_inout *inout_)
|
|||||||
void zmq::zmq_engine_t::unplug ()
|
void zmq::zmq_engine_t::unplug ()
|
||||||
{
|
{
|
||||||
rm_fd (handle);
|
rm_fd (handle);
|
||||||
|
encoder.set_inout (NULL);
|
||||||
|
decoder.set_inout (NULL);
|
||||||
inout = NULL;
|
inout = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user