提交 c6646cb1 编写于 作者: A Alex Smith 提交者: michael-grunder

read: Ensure no invalid '\r' or '\n' in simple status/error strings

上级 e4306115
......@@ -339,6 +339,13 @@ static int processLineItem(redisReader *r) {
obj = (void*)REDIS_REPLY_BOOL;
} else {
/* Type will be error or status. */
for (int i = 0; i < len; i++) {
if (p[i] == '\r' || p[i] == '\n') {
__redisReaderSetError(r,REDIS_ERR_PROTOCOL,
"Bad simple string value");
return REDIS_ERR;
}
}
if (r->fn && r->fn->createString)
obj = r->fn->createString(cur,p,len);
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册