Merge pull request #5068 from shenlongxing/fix-rename-command

fix empty string for sentinel rename-command
This commit is contained in:
Salvatore Sanfilippo 2018-07-02 18:40:35 +02:00 committed by GitHub
commit f03ad96236
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);