0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-15 10:18:01 +08:00

fix divide by zero in zmq::lb_t::sendpipe

This is based on https://github.com/zeromq/zeromq3-x/pull/116/files
This commit is contained in:
Patrick McLean 2017-01-27 17:01:33 -08:00
parent 5853120c1f
commit b5e25e9f12

View File

@ -126,7 +126,9 @@ int zmq::lb_t::sendpipe (msg_t *msg_, pipe_t **pipe_)
more = msg_->flags () & msg_t::more? true: false;
if (!more) {
pipes [current]->flush ();
current = (current + 1) % active;
if (++current >= active)
current = 0;
}
// Detach the message from the data buffer.