Skip to content

Conversation

@aleksraiden
Copy link

Fix Varint decode failing, if buffer empty (1 byte length). Minimal valid command length = 3

Fix Varint decode failing, if buffer empty (1 byte length). Minimal valid command length = 3
@mappum
Copy link
Contributor

mappum commented Mar 18, 2019

Hey @aleksraiden, thanks for the PR.

I'd like to see a test case for this. And can you elaborate more on the rationale? It seems to me that if the client or server is sending empty buffers with a 1-byte varint, we should still be consuming them from the stream instead of waiting to do it with more data.

@aleksraiden
Copy link
Author

As i see, this is "geithenbug". If i connect and read blocks, randomly, i have exception and abci app stop and exit. Yes, any byte at buffer must be checked for valid command, but in this case ve have rangeexception inside the protobuf decoder and then error was propagated to error handler and connection closed. Maybe other solution - return on maybeReadNextMessage if buffer has length == 1, before any varint.decode (today this is first line at fn).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants