提交 17139e19 编写于 作者: H Hongze Cheng

fix read error

上级 26614ff9
......@@ -478,7 +478,7 @@ int tsdbLoadCompIdx(SRWHelper *pHelper, void *target) {
// Decode it
void *ptr = pHelper->pBuffer;
while ((char *)ptr - (char *)pHelper->pBuffer >= pFile->info.len - sizeof(TSCKSUM)) {
while (((char *)ptr - (char *)pHelper->pBuffer) < (pFile->info.len - sizeof(TSCKSUM))) {
uint32_t tid = 0;
if ((ptr = taosDecodeVariant32(ptr, &tid)) == NULL) return -1;
ASSERT(tid > 0 && tid < pHelper->config.maxTables);
......@@ -487,6 +487,8 @@ int tsdbLoadCompIdx(SRWHelper *pHelper, void *target) {
ASSERT((char *)ptr - (char *)pHelper->pBuffer <= pFile->info.len - sizeof(TSCKSUM));
}
ASSERT(((char *)ptr - (char *)pHelper->pBuffer) == (pFile->info.len - sizeof(TSCKSUM)));
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册