mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-26 10:32:58 +01:00
Fixed wrong buffer end detection in v2_decoder.
zero-copy msg_t::init cannot be used when the message exceeds either the buffer end or the last received byte. To detect this, the buffer is now resized to the numnber of received bytes.
This commit is contained in:
@@ -80,9 +80,16 @@ namespace zmq
|
||||
return buf;
|
||||
}
|
||||
|
||||
void resize(size_t new_size)
|
||||
{
|
||||
bufsize = new_size;
|
||||
}
|
||||
|
||||
private:
|
||||
unsigned char* buf;
|
||||
size_t bufsize;
|
||||
size_t maxsize;
|
||||
zmq::atomic_counter_t* msg_refcnt;
|
||||
};
|
||||
|
||||
// Decoder for ZMTP/2.x framing protocol. Converts data stream into messages.
|
||||
|
||||
Reference in New Issue
Block a user