read: Add additional RESP3 nil validation
RESP3 nil should consist of "_\r\n" and nothing else.
This commit is contained in:
parent
96e8ea6110
commit
d8899fbc19
6
read.c
6
read.c
@ -320,6 +320,12 @@ static int processLineItem(redisReader *r) {
|
|||||||
obj = (void*)REDIS_REPLY_DOUBLE;
|
obj = (void*)REDIS_REPLY_DOUBLE;
|
||||||
}
|
}
|
||||||
} else if (cur->type == REDIS_REPLY_NIL) {
|
} 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)
|
if (r->fn && r->fn->createNil)
|
||||||
obj = r->fn->createNil(cur);
|
obj = r->fn->createNil(cur);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user