summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshenlongxing <shenlongxing2012@gmail.com>2018-06-28 01:08:55 +0800
committershenlongxing <shenlongxing2012@gmail.com>2018-06-28 01:08:55 +0800
commit3c27db1cd9a452c52b9b4384dc887bca2d34f2e3 (patch)
treeea3fef0a14f4d5e79badafa3d0ca61624f811a3d
parent345b4809f40d50658daea6de49e4494796e0b60c (diff)
downloadredis-3c27db1cd9a452c52b9b4384dc887bca2d34f2e3.tar.gz
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 512b224e6..f7fcfe823 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);