fix(tsdb/cache): fix buffer-overflow with column adding

This commit is contained in:
Minglei Jin 2023-12-18 18:06:40 +08:00
parent 4cac96d2df
commit 64378be7f4
1 changed files with 10 additions and 0 deletions

View File

@ -2745,6 +2745,13 @@ static int32_t mergeLastCid(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SC
break;
}
SLastCol *pCol = taosArrayGet(pColArray, iCol);
if (slotIds[iCol] > pTSchema->numOfCols - 1) {
if (!setNoneCol) {
noneCol = iCol;
setNoneCol = true;
}
continue;
}
if (pCol->colVal.cid != pTSchema->columns[slotIds[iCol]].colId) {
continue;
}
@ -2919,6 +2926,9 @@ static int32_t mergeLastRowCid(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray,
break;
}
SLastCol *pCol = taosArrayGet(pColArray, iCol);
if (slotIds[iCol] > pTSchema->numOfCols - 1) {
continue;
}
if (pCol->colVal.cid != pTSchema->columns[slotIds[iCol]].colId) {
continue;
}