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

Process does not terminate properly when unzipping invalid zip stream. #8

Open
mmichelsen opened this issue May 6, 2015 · 0 comments

Comments

@mmichelsen
Copy link

After emitting the 'error' event, unzip keeps using cpu time indefinitely unless of course the process is terminated - which is probably the usual use case. When using unzip on a web server which is supposed to recover from unzipping invalid zip files without terminating, the problem is apparent.

A workaround (see below) is to manually set a couple of flags when receiving the error event, but I think that this should be done internally by unzip.

Workaround that makes unzip stop parsing and subsequently emit the 'close' event:
var unzipStream = unzip.Parse();
...

unzipStream.on('error', (err) => {
unzipStream._streamEnd = true;
unzipStream._streamFinish = true;
...
})

johnmalkovich100 pushed a commit to johnmalkovich100/exceljs that referenced this issue Dec 3, 2018
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

No branches or pull requests

1 participant