fix: add block decode check
This commit is contained in:
parent
93568271e1
commit
1bf581db49
|
@ -3036,6 +3036,11 @@ int32_t blockDecode(SSDataBlock* pBlock, const char* pData, const char** pEndPos
|
||||||
// total rows sizeof(int32_t)
|
// total rows sizeof(int32_t)
|
||||||
int32_t numOfRows = *(int32_t*)pStart;
|
int32_t numOfRows = *(int32_t*)pStart;
|
||||||
pStart += sizeof(int32_t);
|
pStart += sizeof(int32_t);
|
||||||
|
if (numOfRows <= 0) {
|
||||||
|
uError("block decode numOfRows:%d error", numOfRows);
|
||||||
|
terrno = TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR;
|
||||||
|
return terrno;
|
||||||
|
}
|
||||||
|
|
||||||
// total columns sizeof(int32_t)
|
// total columns sizeof(int32_t)
|
||||||
int32_t numOfCols = *(int32_t*)pStart;
|
int32_t numOfCols = *(int32_t*)pStart;
|
||||||
|
@ -3084,8 +3089,9 @@ int32_t blockDecode(SSDataBlock* pBlock, const char* pData, const char** pEndPos
|
||||||
|
|
||||||
for (int32_t i = 0; i < numOfCols; ++i) {
|
for (int32_t i = 0; i < numOfCols; ++i) {
|
||||||
colLen[i] = htonl(colLen[i]);
|
colLen[i] = htonl(colLen[i]);
|
||||||
if (colLen[i] < 0) {
|
if (colLen[i] <= 0) {
|
||||||
uError("block decode colLen:%d error, colIdx:%d", colLen[i], i);
|
uError("block decode colLen:%d error, colIdx:%d", colLen[i], i);
|
||||||
|
ASSERT(0);
|
||||||
terrno = TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR;
|
terrno = TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue