From 66c36c38039cfe4957846348233c3f741efe2db4 Mon Sep 17 00:00:00 2001 From: Tommy Brecher Date: Wed, 18 Sep 2024 16:24:29 -0400 Subject: [PATCH] Fix a corner case where if the local_node id is higher than the remote node_id and DNS resolution fails opensips would segfault. --- modules/clusterer/node_info.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/clusterer/node_info.c b/modules/clusterer/node_info.c index ea96ca6aba9..bae6c8f06f7 100644 --- a/modules/clusterer/node_info.c +++ b/modules/clusterer/node_info.c @@ -497,6 +497,10 @@ int load_db_info(db_func_t *dr_dbf, db_con_t* db_hdl, str *db_table, } else if (int_vals[INT_VALS_NODE_ID_COL] == current_id) { LM_ERR("Invalid info for local node\n"); return -1; + } else if (int_vals[INT_VALS_NODE_ID_COL] == current_id && rc == 1) { + LM_ERR("Invalid info for remote node, this will segfault! [%d] current_id=%d\n", + int_vals[INT_VALS_NODE_ID_COL], rc); + return -1; } else { return 2; }