Skip to content

Commit

Permalink
Merge pull request #3463 from vladpaiu/fix_redis_tls_connection_bug
Browse files Browse the repository at this point in the history
Fix fetching TLS domain for a redis connection
  • Loading branch information
liviuchircu authored Sep 11, 2024
2 parents 09faaca + b3e81a6 commit 377d72b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/cachedb_redis/cachedb_redis_dbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ static int redis_init_ssl(char *url_extra_opts, redisContext *ctx,
SSL *ssl;
struct tls_domain *d;

if (tls_dom == NULL) {
if (tls_dom == NULL || *tls_dom == NULL) {
if (strncmp(url_extra_opts, CACHEDB_TLS_DOM_PARAM,
CACHEDB_TLS_DOM_PARAM_LEN)) {
LM_ERR("Invalid Redis URL parameter: %s\n", url_extra_opts);
Expand Down Expand Up @@ -258,6 +258,8 @@ int redis_connect(redis_con *con)
freeReplyObject(rpl);
goto error;
}

memset(con->nodes,0,sizeof(cluster_node) + len + 1);
con->nodes->ip = (char *)(con->nodes + 1);

strcpy(con->nodes->ip,con->host);
Expand Down

0 comments on commit 377d72b

Please sign in to comment.