Skip to content
This repository was archived by the owner on Mar 11, 2021. It is now read-only.

Fix decoding unterminated varint#134

Open
yihuang wants to merge 1 commit intotendermint:developfrom
yihuang:unterminated-varint
Open

Fix decoding unterminated varint#134
yihuang wants to merge 1 commit intotendermint:developfrom
yihuang:unterminated-varint

Conversation

@yihuang
Copy link
Copy Markdown
Contributor

@yihuang yihuang commented Jul 1, 2020

When decoding the prefix varint encoded length, no check on the unterminated variable length encoded length.
After the pr to integer-encoding-rs merged and released, change the dependency.

@yihuang
Copy link
Copy Markdown
Contributor Author

yihuang commented Jul 1, 2020

After reading the abci protocol doc, why it's different from out implementation:

The first byte in the prefix represents the length of the Big Endian encoded length. The remaining bytes in the prefix are the Big Endian encoded length.

For example, if the proto3 encoded ABCI message is 0xDEADBEEF (4 bytes), the length-prefixed message is
0x0104DEADBEEF. If the proto3 encoded ABCI message is 65535 bytes long, the length-prefixed message would be like
0x02FFFF....

It seems we don't handle the first byte?

@tomtau
Copy link
Copy Markdown
Contributor

tomtau commented Jul 23, 2020

will wait for dermesser/integer-encoding-rs#10

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants