diff --git a/lib/composer.js b/lib/composer.js index 80984e0..5c9e1ce 100644 --- a/lib/composer.js +++ b/lib/composer.js @@ -112,7 +112,7 @@ pro._readLength = function(data, offset, end) { length *= LEFT_SHIFT_BITS; // left shift only within 32 bits length += (b & 0x7f); - if(length > this.maxLength) { + if(this.maxLength > 0 && length > this.maxLength) { this.state = ST_ERROR; this.emit('length_limit', this, data, offset); return -1; @@ -173,4 +173,4 @@ var fillLength = function(buf, data, size) { buf.writeUInt8(b, offset); data >>>= 7; } -}; \ No newline at end of file +};