mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-19 08:46:44 +01:00
46 - Devices vulnerable to invalid messages
http://github.com/zeromq/zeromq2/issues#issue/46 Invalid messages are now discarded silently, instead of causing an assertion failure.
This commit is contained in:
parent
e74d350068
commit
5be54b9120
@ -143,8 +143,11 @@ int zmq::xrep_t::xsend (zmq_msg_t *msg_, int flags_)
|
||||
if (!more_out) {
|
||||
zmq_assert (!current_out);
|
||||
|
||||
// There's no such thing as prefix with no subsequent message.
|
||||
zmq_assert (msg_->flags & ZMQ_MSG_MORE);
|
||||
// If we have malformed message (prefix with no subsequent message)
|
||||
// then just silently drop the message.
|
||||
if ((msg_->flags & ZMQ_MSG_MORE) == 0)
|
||||
return 0;
|
||||
|
||||
more_out = true;
|
||||
|
||||
// Find the pipe associated with the identity stored in the prefix.
|
||||
@ -154,7 +157,7 @@ int zmq::xrep_t::xsend (zmq_msg_t *msg_, int flags_)
|
||||
outpipes_t::iterator it = outpipes.find (identity);
|
||||
if (it == outpipes.end ())
|
||||
return 0;
|
||||
|
||||
|
||||
// Remember the outgoing pipe.
|
||||
current_out = it->second.writer;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user