summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxhe <xw897002528@gmail.com>2020-12-24 19:23:30 +0800
committerxhe <xw897002528@gmail.com>2020-12-24 19:23:35 +0800
commit955e00fbec2bf9cb2dbe53fceef00941681bfbd4 (patch)
treecdbcbad7f94fce51a72ef5fa7c0ffb01f5c1aa9f
parent4e36925c662bba9c83661caa166d4699bcbef17c (diff)
downloadredis-955e00fbec2bf9cb2dbe53fceef00941681bfbd4.tar.gz
ask protover for authentication
Signed-off-by: xhe <xw897002528@gmail.com>
-rw-r--r--src/networking.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/networking.c b/src/networking.c
index 6d571aad1..66e91c521 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -2769,6 +2769,11 @@ void helloCommand(client *c) {
return;
}
+ if (!ver && next_arg < c->argc) {
+ addReplyError(c,"Authentication needs to provide an protocol version");
+ return;
+ }
+
for (int j = next_arg; j < c->argc; j++) {
int moreargs = (c->argc-1) - j;
const char *opt = c->argv[j]->ptr;