fix: cpy mem overflow

This commit is contained in:
xsren 2024-09-27 15:24:19 +08:00
parent dc7f309f85
commit 54ea1466fc
1 changed files with 3 additions and 1 deletions

View File

@ -324,7 +324,9 @@ void killAllCheckpointTrans(SMnode *pMnode, SVgroupChangeInfo *pChangeInfo) {
size_t len = 0;
void *pKey = taosHashGetKey(pDb, &len);
tstrncpy(p, pKey, 128);
int cpLen = MIN(127, len);
TAOS_STRNCPY(p, pKey, cpLen);
p[cpLen] = '\0';
int32_t code = doKillCheckpointTrans(pMnode, pKey, len);
if (code) {