zlib: fix node crashing on invalid options · nodejs/node@31bf595 · GitHub
Skip to content

Commit 31bf595

Browse files
aqrlnMylesBorins
authored andcommitted
zlib: fix node crashing on invalid options
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. Backport-PR-URL: #14860 PR-URL: #13098 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>
1 parent 532a294 commit 31bf595

2 files changed

Lines changed: 20 additions & 7 deletions

File tree

lib/zlib.js

Lines changed: 12 additions & 2 deletions

src/node_zlib.cc

Lines changed: 8 additions & 5 deletions

0 commit comments

Comments
 (0)