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(parse): handle no zero in _readString #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bluwy
Copy link

@bluwy bluwy commented Oct 22, 2024

(Sorry for no repro or tests, but I noticed this bug which should be simple to fix)

view.indexOf(0) could return -1 if there's no 0, e.g. if the entire Uint8Array is filled up. If it's -1, view.slice(0, i) would be incorrect because it removes the last item in the Uint8Array.

In this PR, if -1 is found, we don't slice at all. And use the original view instead. I found this bug causing the tarFile.name to be missing the last character otherwise, e.g. .../pkg/package.jso (missing n)

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.

1 participant