summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--read.c6
1 files changed, 6 insertions, 0 deletions
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