mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-19 00:46:05 +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;
|
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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user