From b94fb4c4c7806eb7438829420beca5ef414a100a Mon Sep 17 00:00:00 2001 From: liucc1997 <1192520566@qq.com> Date: Mon, 16 Dec 2024 03:48:37 +0000 Subject: [PATCH] fix KeepAliveClient accessing illegal address when other thread registing dest --- deps/oblib/src/rpc/obrpc/ob_net_keepalive.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deps/oblib/src/rpc/obrpc/ob_net_keepalive.cpp b/deps/oblib/src/rpc/obrpc/ob_net_keepalive.cpp index 4cf9b3178..17f6f35cc 100644 --- a/deps/oblib/src/rpc/obrpc/ob_net_keepalive.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_net_keepalive.cpp @@ -668,6 +668,9 @@ int ret = OB_SUCCESS; for (int i = 0; i < regist_dest_count; i++) { ObTimeGuard timeguard_clent_send("net_keepalive_client_send", 100 * 1000); struct DestKeepAliveState *rs = ATOMIC_LOAD(®ist_dests_[i]); + if (NULL == rs) { + continue; + } if (now - rs->last_access_ts_ > SERVER_EXPIRED_TIME) { if (rs->last_write_ts_ > 0) { char addr_buf[OB_IP_PORT_STR_BUFF] = {'\0'};