From 6e64d8180043b4175c08d76ad2ea938690ac9c42 Mon Sep 17 00:00:00 2001 From: Matt Ranney Date: Thu, 23 Sep 2010 12:21:52 -0700 Subject: [PATCH] Fix parsing mb nil in nested multi-bulk reply. --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index d0cfbc2844..17264d28e9 100644 --- a/index.js +++ b/index.js @@ -253,7 +253,8 @@ RedisReplyParser.prototype.send_reply = function (reply) { RedisReplyParser.prototype.add_multi_bulk_reply = function (reply) { if (this.multi_bulk_replies) { this.multi_bulk_replies.push(reply); - if (this.multi_bulk_replies.length !== this.multi_bulk_length) { + // use "less than" here because a nil mb reply claims "0 length", but we need 1 slot to hold it + if (this.multi_bulk_replies.length < this.multi_bulk_length) { return; } } else {