From 3c27db1cd9a452c52b9b4384dc887bca2d34f2e3 Mon Sep 17 00:00:00 2001 From: shenlongxing Date: Thu, 28 Jun 2018 01:08:55 +0800 Subject: [PATCH] fix empty string for sentinel rename-command --- src/sentinel.c | 5 +++++ 1 file changed, 5 insertions(+) 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);