From c32a0be89cc92a0649277774d1e7aebf349b8b49 Mon Sep 17 00:00:00 2001 From: Dennis Yurasov Date: Tue, 24 Aug 2021 17:15:24 +0300 Subject: [PATCH] ndb_redis: fix SIGSEGV in redisc_check_auth - Added the check for NULL pointer. When TCP session to redis reset, redisCommand function can return NULL pointer. --- src/modules/ndb_redis/redis_client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/ndb_redis/redis_client.c b/src/modules/ndb_redis/redis_client.c index befb69ab79a..bb6adc20b13 100644 --- a/src/modules/ndb_redis/redis_client.c +++ b/src/modules/ndb_redis/redis_client.c @@ -1269,6 +1269,10 @@ int redisc_check_auth(redisc_server_t *rsrv, char *pass) int retval = 0; reply = redisCommand(rsrv->ctxRedis, "AUTH %s", pass); + if(!reply) { + LM_ERR("Redis authentication error\n"); + return -1; + } if (reply->type == REDIS_REPLY_ERROR) { LM_ERR("Redis authentication error\n"); retval = -1;