fix invalid write

This commit is contained in:
Hongze Cheng 2020-07-21 15:39:58 +08:00
parent fac8cf100b
commit 51797a45d5
1 changed files with 1 additions and 1 deletions

View File

@ -530,7 +530,7 @@ int tsdbLoadCompIdx(SRWHelper *pHelper, void *target) {
size_t tlen = tsizeof(pHelper->idxH.pIdxArray);
pHelper->idxH.numOfIdx++;
if (tlen < pHelper->idxH.numOfIdx) {
if (tlen < pHelper->idxH.numOfIdx * sizoef(SCompIdx)) {
pHelper->idxH.pIdxArray = (SCompIdx *)trealloc(pHelper->idxH.pIdxArray, (tlen == 0) ? 1024 : tlen * 2);
if (pHelper->idxH.pIdxArray == NULL) {
terrno = TSDB_CODE_TDB_OUT_OF_MEMORY;