From b9b9f446feca0dda2148b5e3d541ff5e87627a31 Mon Sep 17 00:00:00 2001 From: michael-grunder Date: Sat, 17 Oct 2020 18:46:21 -0700 Subject: Fix handling of NIL invalidation messages. When CLIENT TRACKING is enabled, Redis will send an invalidation message with a NIL payload to all tracking clients after a FLUSHDB is executed. We didn't account for REDIS_REPLY_PUSH being a valid parent object to a NIL payload, and were failing an assertion. Additionally this commit adds a regression test for the logic. --- hiredis.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hiredis.c') diff --git a/hiredis.c b/hiredis.c index 1170d75..3035f79 100644 --- a/hiredis.c +++ b/hiredis.c @@ -257,7 +257,8 @@ static void *createNilObject(const redisReadTask *task) { parent = task->parent->obj; assert(parent->type == REDIS_REPLY_ARRAY || parent->type == REDIS_REPLY_MAP || - parent->type == REDIS_REPLY_SET); + parent->type == REDIS_REPLY_SET || + parent->type == REDIS_REPLY_PUSH); parent->element[task->idx] = r; } return r; -- cgit v1.2.3