From ed01ae09c67fa66bffb1b2a0ee4950521ba85903 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Sun, 29 Sep 2024 19:21:55 +0800 Subject: [PATCH] invalid read --- source/libs/transport/src/transCli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 75f1a6db05..27ad4aa565 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -2110,7 +2110,7 @@ _err: } int32_t initCb(void* thrd, SCliReq* pReq, STransMsg* pResp) { SCliThrd* pThrd = thrd; - if (pReq->ctx == NULL) { + if (pReq->ctx == NULL || pReq->ctx->epSet == NULL) { return 0; } return cliMayCvtFqdnToIp(pReq->ctx->epSet, pThrd->pCvtAddr); @@ -2699,7 +2699,7 @@ void cliMayResetRespCode(SCliReq* pReq, STransMsg* pResp) { } // check whole vnodes is offline on this vgroup - if (pCtx->epsetRetryCnt >= pCtx->epSet->numOfEps || pCtx->retryStep > 0) { + if (((pCtx->epSet != NULL) && pCtx->epsetRetryCnt >= pCtx->epSet->numOfEps) || pCtx->retryStep > 0) { if (pResp->code == TSDB_CODE_RPC_NETWORK_UNAVAIL) { pResp->code = TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED; } else if (pResp->code == TSDB_CODE_RPC_BROKEN_LINK) {