zlib: level can be negative
authorBrian White <mscdex@mscdex.net>
Mon, 1 Jul 2013 09:42:36 +0000 (05:42 -0400)
committerBen Noordhuis <info@bnoordhuis.nl>
Mon, 1 Jul 2013 17:37:50 +0000 (19:37 +0200)
This is a back-port of commit e945903 from the master branch.

src/node_zlib.cc

index ebaba6b..9acbfcb 100644 (file)
@@ -329,7 +329,7 @@ class ZCtx : public ObjectWrap {
     int windowBits = args[0]->Uint32Value();
     assert((windowBits >= 8 && windowBits <= 15) && "invalid windowBits");
 
-    int level = args[1]->Uint32Value();
+    int level = args[1]->Int32Value();
     assert((level >= -1 && level <= 9) && "invalid compression level");
 
     int memLevel = args[2]->Uint32Value();