mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-12 18:40:27 +01:00
assert on malformed messages
This commit is contained in:
parent
c2f3b3b445
commit
10227899b1
@ -56,6 +56,9 @@ bool zmq::zmq_decoder_t::one_byte_size_ready ()
|
||||
|
||||
// TODO: Handle over-sized message decently.
|
||||
|
||||
// There has to be at least one byte (the flags) in the message).
|
||||
zmq_assert (*tmpbuf > 0);
|
||||
|
||||
// in_progress is initialised at this point so in theory we should
|
||||
// close it before calling zmq_msg_init_size, however, it's a 0-byte
|
||||
// message and thus we can treat it as uninitialised...
|
||||
@ -74,6 +77,10 @@ bool zmq::zmq_decoder_t::eight_byte_size_ready ()
|
||||
|
||||
// TODO: Handle over-sized message decently.
|
||||
|
||||
// There has to be at least one byte (the flags) in the message).
|
||||
zmq_assert (size > 0);
|
||||
|
||||
|
||||
// in_progress is initialised at this point so in theory we should
|
||||
// close it before calling zmq_msg_init_size, however, it's a 0-byte
|
||||
// message and thus we can treat it as uninitialised...
|
||||
|
Loading…
Reference in New Issue
Block a user