From ce994d8135f085b33e0f5685cdf50aa46cf934f0 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Thu, 14 Apr 2022 17:04:30 +0200 Subject: [PATCH] RedisConnection::ReadRESP(): *-1\r\n is null, not [ ] --- lib/icingadb/redisconnection.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/icingadb/redisconnection.hpp b/lib/icingadb/redisconnection.hpp index 0a9bfd61d..608b11e0d 100644 --- a/lib/icingadb/redisconnection.hpp +++ b/lib/icingadb/redisconnection.hpp @@ -555,12 +555,12 @@ Value RedisConnection::ReadRESP(AsyncReadStream& stream, boost::asio::yield_cont throw BadRedisInt(std::move(buf)); } - Array::Ptr arr = new Array(); - if (i < 0) { - i = 0; + return Empty; } + Array::Ptr arr = new Array(); + arr->Reserve(i); for (; i; --i) {