Commit c7f75266 authored by Leo Murillo's avatar Leo Murillo Committed by antirez
Browse files

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

parent ed7ea13a
...@@ -602,7 +602,7 @@ void keysCommand(client *c) { ...@@ -602,7 +602,7 @@ void keysCommand(client *c) {
void *replylen = addReplyDeferredLen(c); void *replylen = addReplyDeferredLen(c);
di = dictGetSafeIterator(c->db->dict); di = dictGetSafeIterator(c->db->dict);
allkeys = (pattern[0] == '*' && pattern[1] == '\0'); allkeys = (pattern[0] == '*' && plen == 1);
while((de = dictNext(di)) != NULL) { while((de = dictNext(di)) != NULL) {
sds key = dictGetKey(de); sds key = dictGetKey(de);
robj *keyobj; robj *keyobj;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment