Commit 4db73fc1 authored by Pieter Hintjens's avatar Pieter Hintjens

Problem: msg.cpp:set_routing_id accepts a zero routing ID

Solution: check/reject a zero routing ID with EINVAL.
parent 6b00f40f
...@@ -504,8 +504,12 @@ uint32_t zmq::msg_t::get_routing_id () ...@@ -504,8 +504,12 @@ uint32_t zmq::msg_t::get_routing_id ()
int zmq::msg_t::set_routing_id (uint32_t routing_id_) int zmq::msg_t::set_routing_id (uint32_t routing_id_)
{ {
u.base.routing_id = routing_id_; if (routing_id_) {
return 0; u.base.routing_id = routing_id_;
return 0;
}
errno = EINVAL;
return -1;
} }
zmq::atomic_counter_t *zmq::msg_t::refcnt() zmq::atomic_counter_t *zmq::msg_t::refcnt()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment