Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PrefixInput read #582

Merged
merged 3 commits into from
Apr 30, 2024
Merged

Conversation

kalaninja
Copy link
Contributor

The current implementation of PrefixInput seems to be inconsistent. It checks for the buffer being empty, but only after the prefix is taken, so trying to read with an zero-length buffer discards the prefix and it cannot be read any longer.

Though the behavior can be fixed for the empty buffer case, I think it is better just to remove the check completely and add a "note" comment, since this is an internal mechanism used to parse compacts only and the buffer is always allocated properly.

src/compact.rs Show resolved Hide resolved
src/compact.rs Show resolved Hide resolved
@bkchr bkchr merged commit fa95ed8 into paritytech:master Apr 30, 2024
17 checks passed
@kalaninja kalaninja deleted the kalan/fix-prefixinput branch May 1, 2024 08:03
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