0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/doc/api
Alexey Orlenko 9e4660b518
zlib: fix node crashing on invalid options
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.

* Fix bugs in the validation logic:
  - Don't conflate 0 and undefined when checking if a field of an
    options object exists.
  - Treat NaN and Infinity values the same way as values of invalid
    types instead of allowing to actually set zlib options to NaN or
    Infinity.

PR-URL: https://github.com/nodejs/node/pull/13098
Fixes: https://github.com/nodejs/node/issues/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>
2017-05-22 01:10:44 +03:00
..
_toc.md doc: clarify node.js addons are c++ 2017-05-11 11:09:06 -07:00
addons.md addons: remove semicolons from after module definition 2017-05-15 20:33:06 +02:00
all.md doc: synchronize + update _toc.md and all.md 2017-02-14 19:07:02 -05:00
assert.md doc: sort bottom-of-file markdown links 2017-05-08 09:30:55 -07:00
buffer.md buffer: fix indexOf for empty searches 2017-05-18 23:16:40 +02:00
child_process.md doc: remove unused/duplicated reference links 2017-05-21 00:10:47 +02:00
cli.md src: whitelist new options for NODE_OPTIONS 2017-05-17 12:40:17 -07:00
cluster.md doc: sort bottom-of-file markdown links 2017-05-08 09:30:55 -07:00
console.md doc: replace uses of you and other style nits 2017-04-28 07:57:11 -07:00
crypto.md doc: remove unused/duplicated reference links 2017-05-21 00:10:47 +02:00
debugger.md doc: remove unused/duplicated reference links 2017-05-21 00:10:47 +02:00
deprecations.md fs: Revert throw on invalid callbacks 2017-05-20 10:21:34 -04:00
dgram.md doc: remove unused/duplicated reference links 2017-05-21 00:10:47 +02:00
dns.md dns: support promisified lookup(Service) 2017-05-09 15:01:46 +02:00
documentation.md doc: replace uses of you and other style nits 2017-04-28 07:57:11 -07:00
domain.md doc: sort bottom-of-file markdown links 2017-05-08 09:30:55 -07:00
errors.md doc: edit Error.captureStackTrace html comment 2017-05-21 21:36:07 +02:00
events.md doc: sort bottom-of-file markdown links 2017-05-08 09:30:55 -07:00
fs.md doc: remove unused/duplicated reference links 2017-05-21 00:10:47 +02:00
globals.md doc: sort bottom-of-file markdown links 2017-05-08 09:30:55 -07:00
http.md doc: remove unused/duplicated reference links 2017-05-21 00:10:47 +02:00
https.md doc: remove unused/duplicated reference links 2017-05-21 00:10:47 +02:00
index.md
modules.md doc: replace uses of you and other style nits 2017-04-28 07:57:11 -07:00
n-api.md doc: remove unused/duplicated reference links 2017-05-21 00:10:47 +02:00
net.md doc: remove unused/duplicated reference links 2017-05-21 00:10:47 +02:00
os.md doc: add eslint-plugin-markdown 2017-04-25 00:06:17 +03:00
path.md doc: sort bottom-of-file markdown links 2017-05-08 09:30:55 -07:00
process.md doc: sort bottom-of-file markdown links 2017-05-08 09:30:55 -07:00
punycode.md doc: sort bottom-of-file markdown links 2017-05-08 09:30:55 -07:00
querystring.md doc, test: add note to response.getHeaders 2017-05-10 11:07:15 -04:00
readline.md doc: sort bottom-of-file markdown links 2017-05-08 09:30:55 -07:00
repl.md doc: sort bottom-of-file markdown links 2017-05-08 09:30:55 -07:00
stream.md doc: don't suggest setEncoding for binary streams 2017-05-19 13:02:17 +01:00
string_decoder.md doc: document pending semver-major API changes 2017-02-24 02:06:31 +01:00
synopsis.md
timers.md timers: add promisify support 2017-05-09 15:01:44 +02:00
tls.md tls: accept lookup option for tls.connect() 2017-05-15 17:25:44 -04:00
tracing.md
tty.md
url.md doc: sort bottom-of-file markdown links 2017-05-08 09:30:55 -07:00
util.md util: add util.promisify() 2017-05-09 15:01:41 +02:00
v8.md doc: sort bottom-of-file markdown links 2017-05-08 09:30:55 -07:00
vm.md doc: sort bottom-of-file markdown links 2017-05-08 09:30:55 -07:00
zlib.md zlib: fix node crashing on invalid options 2017-05-22 01:10:44 +03:00