Module: kamailio
Branch: 5.5
Commit: 5dbf99eb03aba76905aa926a55aedd3caa0fcd05
URL:
https://github.com/kamailio/kamailio/commit/5dbf99eb03aba76905aa926a55aedd3…
Author: Dennis Yurasov <dennis-y(a)yandex-team.ru>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-09-09T10:30:30+02:00
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.
(cherry picked from commit c32a0be89cc92a0649277774d1e7aebf349b8b49)
---
Modified: src/modules/ndb_redis/redis_client.c
---
Diff:
https://github.com/kamailio/kamailio/commit/5dbf99eb03aba76905aa926a55aedd3…
Patch:
https://github.com/kamailio/kamailio/commit/5dbf99eb03aba76905aa926a55aedd3…
---
diff --git a/src/modules/ndb_redis/redis_client.c b/src/modules/ndb_redis/redis_client.c
index befb69ab79..bb6adc20b1 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;