Module: kamailio
Branch: master
Commit: c32a0be89cc92a0649277774d1e7aebf349b8b49
URL:
https://github.com/kamailio/kamailio/commit/c32a0be89cc92a0649277774d1e7aeb…
Author: Dennis Yurasov <dennis-y(a)yandex-team.ru>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2021-08-26T11:25:29+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.
---
Modified: src/modules/ndb_redis/redis_client.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c32a0be89cc92a0649277774d1e7aeb…
Patch:
https://github.com/kamailio/kamailio/commit/c32a0be89cc92a0649277774d1e7aeb…
---
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;