Fix bug on KEYS command where pattern starts with * followed by \x00 (null char).

This commit is contained in:
Leo Murillo 2020-01-07 13:55:26 -06:00
parent 0af467d18f
commit 63e46e5f8d

View File

@ -602,7 +602,7 @@ void keysCommand(client *c) {
void *replylen = addReplyDeferredLen(c);
di = dictGetSafeIterator(c->db->dict);
allkeys = (pattern[0] == '*' && pattern[1] == '\0');
allkeys = (pattern[0] == '*' && plen == 1);
while((de = dictNext(di)) != NULL) {
sds key = dictGetKey(de);
robj *keyobj;