]> git.saurik.com Git - redis.git/blobdiff - redis.c
Fixed issue 23 about AUTH
[redis.git] / redis.c
diff --git a/redis.c b/redis.c
index f91616157df99fb3528b9141d805bb0b03a838e0..0ea87cbd395d20ffb9507b916c3c396d1b3e7553 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -2009,7 +2009,7 @@ eoferr: /* unexpected end of file is handled here with a fatal exit */
 /*================================== Commands =============================== */
 
 static void authCommand(redisClient *c) {
-    if (!strcmp(c->argv[1]->ptr, server.requirepass)) {
+    if (!server.requirepass || !strcmp(c->argv[1]->ptr, server.requirepass)) {
       c->authenticated = 1;
       addReply(c,shared.ok);
     } else {