From b6fb548fc65497ce933cfd15b6fd91c700d4b34e Mon Sep 17 00:00:00 2001 From: Björn Svensson Date: Wed, 2 Feb 2022 22:42:23 +0100 Subject: Ignore pubsub replies without a channel/pattern --- async.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'async.c') diff --git a/async.c b/async.c index 6555114..296d31b 100644 --- a/async.c +++ b/async.c @@ -431,8 +431,10 @@ static int __redisGetSubscribeCallback(redisAsyncContext *ac, redisReply *reply, else callbacks = ac->sub.channels; + /* Ignore replies without a channel/pattern string */ + if (reply->element[1]->type != REDIS_REPLY_STRING) return REDIS_OK; + /* Locate the right callback */ - assert(reply->element[1]->type == REDIS_REPLY_STRING); sname = sdsnewlen(reply->element[1]->str,reply->element[1]->len); if (sname == NULL) goto oom; -- cgit v1.2.3