mangrove icon indicating copy to clipboard operation
mangrove copied to clipboard

Fix mangrove crash

Open aospan opened this issue 6 years ago • 2 comments

Crash observed when document length is 257 byte, for example. It represents as '0x01 01 00 00'. In this case '_bytes_read == _len' equal to 1 and callback is called with partial buffer (only 1 byte actually). This cause later crash in 'to_dotted_notation_document'

Signed-off-by: Abylay Ospan [email protected]

aospan avatar Sep 14 '18 15:09 aospan

Wow, good catch!

rkargon avatar Sep 14 '18 16:09 rkargon

@rkargon tnx :)

BTW, better to implement: streamsize xsputn (const char* s, streamsize n);

then we shouldn't care about buffer assembly and avoid byte-by-byte copy (which can slow down whole process)

aospan avatar Sep 14 '18 17:09 aospan