From 2c3d2f8b8708968ac25eb95d30c6d0bea7c69aa3 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 fb9d1e584..3023fa3e9 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) {