Skip to content

Commit

Permalink
ndb_redis: fix SIGSEGV in redisc_check_auth
Browse files Browse the repository at this point in the history
- Added the check for NULL pointer. When TCP session to redis reset,
  redisCommand function can return NULL pointer.
  • Loading branch information
Den4t authored and linuxmaniac committed Aug 26, 2021
1 parent 79b3980 commit c32a0be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/ndb_redis/redis_client.c
Expand Up @@ -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;
Expand Down

0 comments on commit c32a0be

Please sign in to comment.