summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2018-07-02 18:40:35 +0200
committerGitHub <noreply@github.com>2018-07-02 18:40:35 +0200
commitf03ad96236a9b446b0ada85256d4a067ce3c217c (patch)
treea6fdcb0c72da91d587a095394c63b347b56b8c19
parente4881cd08365b7ebe293c33c65c6a6eb32e93ce7 (diff)
parent3c27db1cd9a452c52b9b4384dc887bca2d34f2e3 (diff)
downloadredis-f03ad96236a9b446b0ada85256d4a067ce3c217c.tar.gz
Merge pull request #5068 from shenlongxing/fix-rename-command
fix empty string for sentinel rename-command
-rw-r--r--src/sentinel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sentinel.c b/src/sentinel.c
index c820169af..be77f0616 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -3482,6 +3482,11 @@ void sentinelSetCommand(client *c) {
sds oldname = c->argv[++j]->ptr;
sds newname = c->argv[++j]->ptr;
+ if ((sdslen(oldname) == 0) || (sdslen(newname) == 0)) {
+ badarg = sdslen(newname) ? j-1 : j;
+ goto badfmt;
+ }
+
/* Remove any older renaming for this command. */
dictDelete(ri->renamed_commands,oldname);