Commit 8651b557 authored by Martin Hurton's avatar Martin Hurton

PLAIN: Fix parsing of ERROR command

parent 3338c76b
...@@ -199,12 +199,8 @@ int zmq::plain_client_t::process_error ( ...@@ -199,12 +199,8 @@ int zmq::plain_client_t::process_error (
errno = EPROTO; errno = EPROTO;
return -1; return -1;
} }
if (data_size == 6) { const size_t error_reason_len = data_size - 6;
errno = EPROTO; if (error_reason_len < 1 || error_reason_len > 255) {
return -1;
}
const size_t size = static_cast <size_t> (cmd_data [6]);
if (6 + 1 + size != data_size) {
errno = EPROTO; errno = EPROTO;
return -1; return -1;
} }
......
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