Skip to content

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.

@kalaninja kalaninja force-pushed the kalan/fix-prefixinput branch from 408864f to 0624055 Compare April 30, 2024 01:37
@kalaninja kalaninja force-pushed the kalan/fix-prefixinput branch from 0624055 to 570ffb8 Compare April 30, 2024 01:44
@kalaninja kalaninja requested a review from bkchr April 30, 2024 10:38
@bkchr bkchr merged commit fa95ed8 into paritytech:master Apr 30, 2024
@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