| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
This is a partial backport of semver-patch bits of 9e4660b. This commit fixes the Node process crashing when constructors of classes of the zlib module are given invalid options. * Throw an Error when the zlib library rejects the value of windowBits, instead of crashing with an assertion. * Treat windowBits and memLevel options consistently with other ones and don't crash when non-numeric values are given. Refs: nodejs#13098
| ctx->init_done_ = true; | ||
|
|
||
| if (ctx->err_ != Z_OK) { | ||
| if (dictionary != nullptr) { |
There was a problem hiding this comment.
fwiw, you don't need the conditional, the following two lines of code can run correctly whether dictionary is nullptr or not.
Sorry, something went wrong.
There was a problem hiding this comment.
Oh, nice. Thanks.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM % small nits
Sorry, something went wrong.
| var memLevel = exports.Z_DEFAULT_MEMLEVEL; | ||
| if (typeof opts.memLevel === 'number') memLevel = opts.memLevel; | ||
|
|
||
| this._handle.init(windowBits || exports.Z_DEFAULT_WINDOWBITS, |
There was a problem hiding this comment.
If your changing this line anyway, IMHO handle the fallback in 383 (opts.windowBits && typeof...)
Sorry, something went wrong.
| this._handle.init(windowBits || exports.Z_DEFAULT_WINDOWBITS, | ||
| level, | ||
| opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, | ||
| memLevel || exports.Z_DEFAULT_MEMLEVEL, |
There was a problem hiding this comment.
ditto
Sorry, something went wrong.
|
|
||
| // For raw deflate encoding, requests for 256-byte windows are rejected as | ||
| // invalid by zlib. | ||
| // (http://zlib.net/manual.html#Advanced) |
There was a problem hiding this comment.
change to:
Ref: http://zlib.net/manual.html#Advanced
Dismissed
Sorry, something went wrong.
There was a problem hiding this comment.
Not a good idea to change this one since that's how it is already committed to master.
Sorry, something went wrong.
There was a problem hiding this comment.
Ack.
Sorry, something went wrong.
There was a problem hiding this comment.
Win! 💯
(appreciated all the branch juggling you did for that)
Sorry, something went wrong.
Sorry, something went wrong.
|
This can land once we do the next v6.x release |
Sorry, something went wrong.
Sorry, something went wrong.
This is a partial backport of semver-patch bits of 9e4660b. This commit fixes the Node process crashing when constructors of classes of the zlib module are given invalid options. * Throw an Error when the zlib library rejects the value of windowBits, instead of crashing with an assertion. * Treat windowBits and memLevel options consistently with other ones and don't crash when non-numeric values are given. PR-URL: nodejs#13098 Backport-PR-URL: nodejs#13201 Fixes: nodejs#13082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This is a partial backport of semver-patch bits of 9e4660b. This commit fixes the Node process crashing when constructors of classes of the zlib module are given invalid options. * Throw an Error when the zlib library rejects the value of windowBits, instead of crashing with an assertion. * Treat windowBits and memLevel options consistently with other ones and don't crash when non-numeric values are given. PR-URL: #13098 Backport-PR-URL: #13201 Fixes: #13082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This is a partial backport of semver-patch bits of 9e4660b. This commit fixes the Node process crashing when constructors of classes of the zlib module are given invalid options. * Throw an Error when the zlib library rejects the value of windowBits, instead of crashing with an assertion. * Treat windowBits and memLevel options consistently with other ones and don't crash when non-numeric values are given. PR-URL: #13098 Backport-PR-URL: #13201 Fixes: #13082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
|
This should probably be released together with #14666 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This is a partial backport of semver-patch bits of 9e4660b.
This commit fixes the Node process crashing when constructors of classes
of the zlib module are given invalid options.
Throw an Error when the zlib library rejects the value of windowBits,
instead of crashing with an assertion.
Treat windowBits and memLevel options consistently with other ones and
don't crash when non-numeric values are given.
Refs: #13098
Checklist
Affected core subsystem(s)
zlib