From 1c8c37aef9ce92a98599fa85ab34645eabba27f6 Mon Sep 17 00:00:00 2001 From: kedixaliu Date: Thu, 25 Aug 2022 19:24:59 +0800 Subject: [PATCH] fix redis parse response bug --- src/protocol/redis_parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/protocol/redis_parser.c b/src/protocol/redis_parser.c index 31c22749..6ca52efe 100644 --- a/src/protocol/redis_parser.c +++ b/src/protocol/redis_parser.c @@ -14,6 +14,7 @@ limitations under the License. Authors: Wu Jiaxu (wujiaxu@sogou-inc.com) + Liu Kai (liukaidx@sogou-inc.com) */ #include @@ -449,7 +450,7 @@ int redis_parser_append_message(const void *buf, size_t *size, memcpy((char *)parser->msgbuf + parser->msgsize, buf, *size); parser->msgsize += *size; - if (parser->msgsize && *(const char *)parser->msgbuf != '*') + if (parser->msgsize && isalpha(*(const char *)parser->msgbuf)) { while (parser->msgidx < parser->msgsize && *((const char *)parser->msgbuf + parser->msgidx) != '\n')