mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 18:55:10 +01:00
PLAIN: Fix parsing of ERROR command
This commit is contained in:
parent
3338c76bac
commit
8651b55797
@ -199,12 +199,8 @@ int zmq::plain_client_t::process_error (
|
||||
errno = EPROTO;
|
||||
return -1;
|
||||
}
|
||||
if (data_size == 6) {
|
||||
errno = EPROTO;
|
||||
return -1;
|
||||
}
|
||||
const size_t size = static_cast <size_t> (cmd_data [6]);
|
||||
if (6 + 1 + size != data_size) {
|
||||
const size_t error_reason_len = data_size - 6;
|
||||
if (error_reason_len < 1 || error_reason_len > 255) {
|
||||
errno = EPROTO;
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user