mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-27 11:06:52 +01:00
Fix the segfault when over-sized message is rejected.
The in_progress message inside of decoder was left uninitialised in such a case. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
@@ -92,6 +92,8 @@ bool zmq::decoder_t::eight_byte_size_ready ()
|
|||||||
// message and thus we can treat it as uninitialised...
|
// message and thus we can treat it as uninitialised...
|
||||||
int rc = zmq_msg_init_size (&in_progress, size - 1);
|
int rc = zmq_msg_init_size (&in_progress, size - 1);
|
||||||
if (rc != 0 && errno == ENOMEM) {
|
if (rc != 0 && errno == ENOMEM) {
|
||||||
|
rc = zmq_msg_init (&in_progress);
|
||||||
|
errno_assert (rc == 0);
|
||||||
decoding_error ();
|
decoding_error ();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user