未验证 提交 1806815f 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #17567 from taosdata/fix/TD-19646

rm invalid read
...@@ -43,7 +43,7 @@ void* rpcOpen(const SRpcInit* pInit) { ...@@ -43,7 +43,7 @@ void* rpcOpen(const SRpcInit* pInit) {
return NULL; return NULL;
} }
if (pInit->label) { if (pInit->label) {
tstrncpy(pRpc->label, pInit->label, TSDB_LABEL_LEN); tstrncpy(pRpc->label, pInit->label, sizeof(pRpc->label));
} }
pRpc->compressSize = pInit->compressSize; pRpc->compressSize = pInit->compressSize;
...@@ -75,7 +75,7 @@ void* rpcOpen(const SRpcInit* pInit) { ...@@ -75,7 +75,7 @@ void* rpcOpen(const SRpcInit* pInit) {
} }
pRpc->parent = pInit->parent; pRpc->parent = pInit->parent;
if (pInit->user) { if (pInit->user) {
memcpy(pRpc->user, pInit->user, TSDB_UNI_LEN); tstrncpy(pRpc->user, pInit->user, sizeof(pRpc->user));
} }
int64_t refId = transAddExHandle(transGetInstMgt(), pRpc); int64_t refId = transAddExHandle(transGetInstMgt(), pRpc);
...@@ -87,7 +87,7 @@ void rpcClose(void* arg) { ...@@ -87,7 +87,7 @@ void rpcClose(void* arg) {
tInfo("start to close rpc"); tInfo("start to close rpc");
transRemoveExHandle(transGetInstMgt(), (int64_t)arg); transRemoveExHandle(transGetInstMgt(), (int64_t)arg);
transReleaseExHandle(transGetInstMgt(), (int64_t)arg); transReleaseExHandle(transGetInstMgt(), (int64_t)arg);
tInfo("rpc is closed"); tInfo("end to close rpc");
return; return;
} }
void rpcCloseImpl(void* arg) { void rpcCloseImpl(void* arg) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册