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

decode_vmslice is misleading #1225

Closed
jayz22 opened this issue Nov 17, 2023 · 0 comments · Fixed by #1285
Closed

decode_vmslice is misleading #1225

jayz22 opened this issue Nov 17, 2023 · 0 comments · Fixed by #1285
Labels
bug Something isn't working

Comments

@jayz22
Copy link
Contributor

jayz22 commented Nov 17, 2023

The decode_vmslice function is misleading. It doesn't decode anything, it is merely cloning out the VM (or error if not a in contract), and return it with whatever pos and len values that have been passed in, even if those values do not correspond to valid linear memory range. It does not perform any checks.
It is being used wrong in several places. e.g. in map_new_from_linear_memory, the len is actually the number of slices (8-bytes pos|len code), not the number of bytes.

@jayz22 jayz22 added the bug Something isn't working label Nov 17, 2023
github-merge-queue bot pushed a commit that referenced this issue Dec 3, 2023
This covers the remainder of my code review on soroban.

Fixes #1225
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant