Merge pull request #6746 from leomurillo/unstable

Fix bug on KEYS command where pattern starts with * followed by \x00
This commit is contained in:
Salvatore Sanfilippo 2020-01-10 12:18:19 +01:00 committed by GitHub
commit 51a01ca8a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;