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

zlib: check if the stream is destroyed before push (8.x) #14396

Merged
merged 1 commit into from
Jul 20, 2017

Conversation

Fishrock123
Copy link
Contributor

Backport of #14330

Conflicts:
lib/zlib.js

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Of note, it looks like the line above should also have buffer = null but perhaps that should be addressed separately.

I can confirm the test works on 8.x.

@Fishrock123 Fishrock123 added v8.x zlib Issues and PRs related to the zlib subsystem. labels Jul 20, 2017
@nodejs-github-bot nodejs-github-bot added v8.x zlib Issues and PRs related to the zlib subsystem. labels Jul 20, 2017
lib/zlib.js Outdated
@@ -431,6 +431,11 @@ Zlib.prototype._processChunk = function _processChunk(chunk, flushFlag, cb) {
if (self._hadError)
return;

if (self.destroyed) {
this.buffer = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a nit.

@Fishrock123 Fishrock123 force-pushed the v8.x-backport-aa496f4 branch 2 times, most recently from dea2d71 to f1254b5 Compare July 20, 2017 17:33
If the stream is destroyed while the transform is still being
applied, push() should not be called, and the internal state
should be cleared.

Refs: koajs/compress#60
PR-URL: nodejs#14330
Backport-PR-URL: nodejs#14396
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

 Conflicts:
	lib/zlib.js
@Fishrock123 Fishrock123 merged commit 6fce1a3 into nodejs:v8.x-staging Jul 20, 2017
@Fishrock123 Fishrock123 deleted the v8.x-backport-aa496f4 branch July 20, 2017 17:56
@Fishrock123 Fishrock123 mentioned this pull request Jul 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
zlib Issues and PRs related to the zlib subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants