未验证 提交 a6df415b 编写于 作者: D dapan1121 提交者: GitHub

Merge pull request #7410 from taosdata/fix/TD-6131

[TD-6131]<fix> handle mem corrupt
......@@ -298,7 +298,7 @@ void *mnodeGetDnodeByEp(char *ep) {
while (1) {
pIter = mnodeGetNextDnode(pIter, &pDnode);
if (pDnode == NULL) break;
if (strcmp(ep, pDnode->dnodeEp) == 0) {
if (strncasecmp(ep, pDnode->dnodeEp, TSDB_EP_LEN) == 0) {
mnodeCancelGetNextDnode(pIter);
return pDnode;
}
......@@ -1199,7 +1199,12 @@ static int32_t mnodeGetVnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
SDnodeObj *pDnode = NULL;
if (pShow->payloadLen > 0 ) {
pDnode = mnodeGetDnodeByEp(pShow->payload);
char ep[TSDB_EP_LEN] = {0};
// not use tstrncpy to make runtime happy
uint16_t len = (pShow->payloadLen + 1) > TSDB_EP_LEN ? TSDB_EP_LEN :(pShow->payloadLen + 1);
strncpy(ep, pShow->payload, len - 1);
pDnode = mnodeGetDnodeByEp(ep);
} else {
void *pIter = mnodeGetNextDnode(NULL, (SDnodeObj **)&pDnode);
mnodeCancelGetNextDnode(pIter);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册