We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce770de commit 661c740Copy full SHA for 661c740
1 file changed
test/parallel/test-regress-GH-io-1811.js
@@ -0,0 +1,21 @@
1
+'use strict';
2
+
3
+const assert = require('assert');
4
5
+// Change kMaxLength to trigger the error without having
6
+// to allocate 1GB of buffers
7
+process.binding('smalloc').kMaxLength = 128;
8
9
+const zlib = require('zlib');
10
11
+const encoded = new Buffer('H4sIAAAAAAAAA0tMHFgAAIw2K/GAAAAA', 'base64');
12
13
+// Async
14
+zlib.gunzip(encoded, function(err) {
15
+ assert.ok(err instanceof RangeError);
16
+});
17
18
+// Sync
19
+assert.throws(function() {
20
+ zlib.gunzipSync(encoded);
21
+}, RangeError);
0 commit comments