Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

zlib unpacking yields in assertion error #1882

Closed
andris9 opened this issue Oct 13, 2011 · 3 comments
Closed

zlib unpacking yields in assertion error #1882

andris9 opened this issue Oct 13, 2011 · 3 comments
Assignees

Comments

@andris9
Copy link

andris9 commented Oct 13, 2011

Node.js: v0.5.9, v0.5.8
Systems: OSX, Debian Lenny

When trying to unpack (gunzip or inflte) data with zlib, assertion error occurs.

Using he following script (slightly modified from the zlib section in node.js manual, createGzip changed to createGunzip) and the output length (unpacked.txt) should be 32kB or larger:

var zlib = require('zlib');
var gzip = zlib.createGunzip();
var fs = require('fs');
var inp = fs.createReadStream('packed.gz');
var out = fs.createWriteStream('unpacked.txt');

inp.pipe(gzip).pipe(out);

The following error occurs:

node: ../src/node_zlib.cc:104: static v8::Handle<v8::Value> 
    node::ZCtx<mode>::Write(const v8::Arguments&) [with 
    node::node_zlib_mode mode = INFLATERAW]: 
    Assertion `in_off + in_len <= Buffer::Length(in_buf)' failed.
Aborted
@isaacs
Copy link

isaacs commented Oct 13, 2011

I can reproduce. Investigating.

@ghost ghost assigned isaacs Oct 13, 2011
@isaacs isaacs closed this as completed in 59a5262 Oct 13, 2011
@andris9
Copy link
Author

andris9 commented Oct 14, 2011

wow, that was fast, thanks!

@isaacs
Copy link

isaacs commented Oct 14, 2011

Failing assert + reproducible test = easy fix :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants