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 6970045Copy full SHA for 6970045
test/parallel/test-regress-GH-io-1811.js
@@ -0,0 +1,22 @@
1
+'use strict';
2
+
3
+const assert = require('assert');
4
5
+// Change kMaxLength for zlib to trigger the error
6
+// without having to allocate 1GB of buffers
7
+const smalloc = process.binding('smalloc');
8
+smalloc.kMaxLength = 128;
9
+const zlib = require('zlib');
10
+smalloc.kMaxLength = 0x3fffffff;
11
12
+const encoded = new Buffer('H4sIAAAAAAAAA0tMHFgAAIw2K/GAAAAA', 'base64');
13
14
+// Async
15
+zlib.gunzip(encoded, function(err) {
16
+ assert.ok(err instanceof RangeError);
17
+});
18
19
+// Sync
20
+assert.throws(function() {
21
+ zlib.gunzipSync(encoded);
22
+}, RangeError);
0 commit comments