summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2020-01-10 12:18:19 +0100
committerGitHub <noreply@github.com>2020-01-10 12:18:19 +0100
commit51a01ca8a630fbdee3a1e71fbf318225652afea9 (patch)
tree9f8a26e316c54bca76ca97f5389221ce5cc82e5b
parentb8d315ff7686dcf7883a3ed2970ff8cc68215daa (diff)
parent63e46e5f8db68f3b8b5e0ea6b3b852b1068c9894 (diff)
downloadredis-51a01ca8a630fbdee3a1e71fbf318225652afea9.tar.gz
Merge pull request #6746 from leomurillo/unstable
Fix bug on KEYS command where pattern starts with * followed by \x00
-rw-r--r--src/db.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/db.c b/src/db.c
index 32bb35652..ba7be2725 100644
--- a/src/db.c
+++ b/src/db.c
@@ -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;