dchapyshev / aspia

Remote desktop and file transfer tool.
https://aspia.org
GNU General Public License v3.0
1.61k stars 346 forks source link

VariableSizeReader::buffer size may mistake #138

Closed iByteSpace closed 2 years ago

iByteSpace commented 2 years ago

The size of VariableSizeReader::buffer_ is 4 bytes.

But mutable_buffer of VariableSizeReader::buffer returned is 1 byte (sizeof(uint8_t)).

So from asio::read, you can only read 1 byte at most. This may be an error.

dchapyshev commented 2 years ago

It's not a error. This is a buffer that is written byte by byte. In this case, each of the bytes can be the last. This is indicated by the name of the class - VariableSizeReader.