1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Fix parser regression. Out of memory resulted in an endless loop

This commit is contained in:
Ruben Bridgewater
2015-09-19 17:40:09 +02:00
parent 26e5764214
commit 083e446d23
2 changed files with 39 additions and 0 deletions

View File

@@ -220,6 +220,11 @@ ReplyParser.prototype._packetEndOffset = function () {
while (this._buffer[offset] !== 0x0d && this._buffer[offset + 1] !== 0x0a) {
offset++;
/* istanbul ignore if: activate the js parser out of memory test to test this */
if (offset >= this._buffer.length) {
throw new IncompleteReadBuffer("didn't see LF after NL reading multi bulk count (" + offset + " => " + this._buffer.length + ", " + this._offset + ")");
}
}
offset++;