mirror of https://github.com/lukechilds/node.git
Browse Source
This is a partial backport of semver-patch bits of
9e4660b518
.
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: https://github.com/nodejs/node/pull/14860
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>
v4.x-staging
Alexey Orlenko
8 years ago
committed by
Myles Borins
4 changed files with 37 additions and 7 deletions
@ -0,0 +1,13 @@ |
|||
'use strict'; |
|||
|
|||
require('../common'); |
|||
|
|||
const assert = require('assert'); |
|||
const zlib = require('zlib'); |
|||
|
|||
// For raw deflate encoding, requests for 256-byte windows are rejected as
|
|||
// invalid by zlib.
|
|||
// (http://zlib.net/manual.html#Advanced)
|
|||
assert.throws(() => { |
|||
zlib.createDeflateRaw({ windowBits: 8 }); |
|||
}, /^Error: Init error$/); |
Loading…
Reference in new issue