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

rm invalid read
This commit is contained in:
Shengliang Guan 2022-10-22 08:16:15 +08:00 committed by GitHub
commit 1806815fe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@ void* rpcOpen(const SRpcInit* pInit) {
return NULL;
}
if (pInit->label) {
tstrncpy(pRpc->label, pInit->label, TSDB_LABEL_LEN);
tstrncpy(pRpc->label, pInit->label, sizeof(pRpc->label));
}
pRpc->compressSize = pInit->compressSize;
@ -75,7 +75,7 @@ void* rpcOpen(const SRpcInit* pInit) {
}
pRpc->parent = pInit->parent;
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);
@ -87,7 +87,7 @@ void rpcClose(void* arg) {
tInfo("start to close rpc");
transRemoveExHandle(transGetInstMgt(), (int64_t)arg);
transReleaseExHandle(transGetInstMgt(), (int64_t)arg);
tInfo("rpc is closed");
tInfo("end to close rpc");
return;
}
void rpcCloseImpl(void* arg) {