summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Murillo <leonardo.murillo@gmail.com>2020-01-07 13:55:26 -0600
committerantirez <antirez@gmail.com>2020-03-05 16:26:32 +0100
commitf3b77510effad00db8554331a257e93968a977c2 (patch)
tree7e39eb2da4800274787f181b38ac72faf11427b2
parent7f3fcedb8ca14a557074bf679f77a6eef97b9b81 (diff)
downloadredis-f3b77510effad00db8554331a257e93968a977c2.tar.gz
Fix bug on KEYS command where pattern starts with * followed by \x00 (null char).
-rw-r--r--src/db.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/db.c b/src/db.c
index e5a672a5c..583335dce 100644
--- a/src/db.c
+++ b/src/db.c
@@ -542,7 +542,7 @@ void keysCommand(client *c) {
void *replylen = addDeferredMultiBulkLength(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;