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

Add error handler to zipfile object #67

Merged
merged 1 commit into from
Mar 25, 2020
Merged

Conversation

matsnow
Copy link
Contributor

@matsnow matsnow commented Mar 21, 2018

@malept
This PR adds the error handler to zipfile object before zipfile.readEntry called.
The reason is It causes unhandled exception when extract broken zip (ex. Central Directory Entry has been broken).

events.js:137
      throw er; // Unhandled 'error' event
      ^

Error: invalid central directory file header signature: 0x2014b00
    at /Users/matsuo/develop/projects/extract-zip/node_modules/yauzl/index.js:231:70
    at /Users/matsuo/develop/projects/extract-zip/node_modules/yauzl/index.js:473:5
    at /Users/matsuo/develop/projects/extract-zip/node_modules/fd-slicer/index.js:32:7
    at FSReqWrap.wrapper [as oncomplete] (fs.js:676:17)

Currently, I use the forked library into my product, but more better is to apply this patch.
Best regards!

@malept
Copy link
Collaborator

malept commented Mar 21, 2018

This seems reasonable but since this module is not my area of expertise (I'm here to merge and deploy security fixes), I would like at least one other person to review this.

@matsnow
Copy link
Contributor Author

matsnow commented Mar 21, 2018

@malept
Thanks for your reponse!

@maxogden
Would you mind reviewing this PR?

@aileen aileen mentioned this pull request May 11, 2018
aileen referenced this pull request in TryGhost/extract-zip Jan 3, 2019
@malept malept merged commit 990fc64 into max-mapper:master Mar 25, 2020
@papb
Copy link

papb commented Mar 25, 2020

It is great to see this merged! I probably no longer need this line of code

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