From d8899fbc190d49bb09c2576035d4db4ead185846 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Thu, 15 Oct 2020 17:54:58 -0400 Subject: read: Add additional RESP3 nil validation RESP3 nil should consist of "_\r\n" and nothing else. --- read.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/read.c b/read.c index 34fce2e..57da853 100644 --- a/read.c +++ b/read.c @@ -320,6 +320,12 @@ static int processLineItem(redisReader *r) { obj = (void*)REDIS_REPLY_DOUBLE; } } else if (cur->type == REDIS_REPLY_NIL) { + if (len != 0) { + __redisReaderSetError(r,REDIS_ERR_PROTOCOL, + "Bad nil value"); + return REDIS_ERR; + } + if (r->fn && r->fn->createNil) obj = r->fn->createNil(cur); else -- cgit v1.2.3