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

Asar support breaks on asar archives where JSON header size >= 240 #406

Closed
timojaask opened this issue Oct 20, 2020 · 2 comments · Fixed by #453
Closed

Asar support breaks on asar archives where JSON header size >= 240 #406

timojaask opened this issue Oct 20, 2020 · 2 comments · Fixed by #453
Labels

Comments

@timojaask
Copy link

The support for asar works only on asar archives where JSON header size is less than 240 bytes.

I'm not sure why this limitation was added in the original PR #378. It looks like the exact logic came from this PR https://github.com/dyoshikawa/file-type/pull/1/files.

@Borewit do you remember if there was a reason why did you limit it to 240?
if (jsonSize > 12 && jsonSize < 240 && buffer.length >= jsonSize + 16) {

You can easily break this by creating an asar archive that contains just a few more files and makes the JSON longer than 240 bytes.

@Borewit
Copy link
Collaborator

Borewit commented Oct 26, 2020

@Borewit do you remember if there was a reason why did you limit it to 240?

Sorry, I don't remember.

@Borewit Borewit added the bug label May 9, 2021
@Borewit
Copy link
Collaborator

Borewit commented May 9, 2021

I could not find any reason for the 240 header length limit, therefor I will remove it. Thanks for bringing this to our attention @timojaask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants