summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--redis.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/redis.c b/redis.c
index 2790554de..aa1833704 100644
--- a/redis.c
+++ b/redis.c
@@ -7601,6 +7601,10 @@ static void execCommand(redisClient *c) {
c->argc = c->mstate.commands[j].argc;
c->argv = c->mstate.commands[j].argv;
call(c,c->mstate.commands[j].cmd);
+
+ /* Commands may alter argc/argv, restore mstate. */
+ c->mstate.commands[j].argc = c->argc;
+ c->mstate.commands[j].argv = c->argv;
}
c->argv = orig_argv;
c->argc = orig_argc;