zlib: don't assert on malformed dictionary
authorBen Noordhuis <info@bnoordhuis.nl>
Tue, 22 Jan 2013 12:23:46 +0000 (13:23 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Tue, 22 Jan 2013 12:34:43 +0000 (13:34 +0100)
commitd7bf7ed9935587a6681a090e5d12840f9a60f55e
treee42875903c67c12f59f3e74bfbd489ec5f8f2d7e
parent1c32eb4ae227f09e0e442ecd0445ec34d85332fe
zlib: don't assert on malformed dictionary

Handle Z_DATA_ERROR errors from inflateSetDictionary() gracefully.
Fixes the following assertion:

  node: ../src/node_zlib.cc:167: static void node::ZCtx::Process
  (uv_work_t*): Assertion `ctx->err_ == 0 && "Failed to set
  dictionary"' failed.
  Aborted (core dumped)

Fixes #4632.
src/node_zlib.cc
test/simple/test-zlib-dictionary-fail.js