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

BufferedData slices are still broken #90

Closed
artemananiev opened this issue Aug 26, 2023 · 0 comments · Fixed by #91
Closed

BufferedData slices are still broken #90

artemananiev opened this issue Aug 26, 2023 · 0 comments · Fixed by #91
Assignees
Labels
P1 High priority issue, which must be completed in the milestone otherwise the release is at risk.

Comments

@artemananiev
Copy link
Member

The fix for #83 is incomplete. I use BufferedData.readVarInt() in MerkleDb, it was touched in that fix, but some pieces are still missing.

In particular, to read bytes BufferedData now takes wrapped buffer offset into consideration:

        int tempPos = buffer.position() + buffer.arrayOffset();

However, when it needs to forward buffer position later, the offset is ignored:

            buffer.position(tempPos);

Instead, it should be

            buffer.position(tempPos - buffer.arrayOffset());

There may be more places broken like this.

@artemananiev artemananiev added the P1 High priority issue, which must be completed in the milestone otherwise the release is at risk. label Aug 26, 2023
artemananiev added a commit that referenced this issue Aug 29, 2023
Fixes: #90
Reviewed-by: Ivan Malygin <ivan@swirldslabs.com>, Richard Bair <richard@swirldslabs.com>
Signed-off-by: Artem Ananev <artem.ananev@swirldslabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority issue, which must be completed in the milestone otherwise the release is at risk.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants