You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Bounds checking on Array expansion magic.
This commit is contained in:
2
index.js
2
index.js
@@ -632,7 +632,7 @@ RedisClient.prototype.send_command = function (command, args, callback) {
|
|||||||
// and converts to:
|
// and converts to:
|
||||||
// client.command(arg1, arg2, arg3, arg4, cb);
|
// client.command(arg1, arg2, arg3, arg4, cb);
|
||||||
// which is convenient for some things like sadd
|
// which is convenient for some things like sadd
|
||||||
if (Array.isArray(args[args.length - 1])) {
|
if (args.length > 0 && Array.isArray(args[args.length - 1])) {
|
||||||
args = args.slice(0, -1).concat(args[args.length - 1]);
|
args = args.slice(0, -1).concat(args[args.length - 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
test.js
2
test.js
@@ -158,7 +158,7 @@ tests.MULTI_3 = function () {
|
|||||||
// make sure empty mb reply works
|
// make sure empty mb reply works
|
||||||
assert.strictEqual(true, is_empty_array(reply), name);
|
assert.strictEqual(true, is_empty_array(reply), name);
|
||||||
});
|
});
|
||||||
|
|
||||||
// test nested multi-bulk replies with empty mb elements.
|
// test nested multi-bulk replies with empty mb elements.
|
||||||
client.multi([
|
client.multi([
|
||||||
["smembers", "some set"],
|
["smembers", "some set"],
|
||||||
|
Reference in New Issue
Block a user