提交 cb667b5d 编写于 作者: W wangyunlai.wyl

fix white box scan

上级 23e35e05
......@@ -100,7 +100,7 @@ static inline void toLeEndian(void* buf, int size)
{
#if ENDIANNESS_LE
return;
#endif
#else // ENDIANNESS_LE
switch (size) {
case 1:
*((uint8_t*)buf) = swap8(*(uint8_t*)buf);
......@@ -115,6 +115,7 @@ static inline void toLeEndian(void* buf, int size)
*((uint64_t*)buf) = swap64(*(uint64_t*)buf);
break;
}
#endif // ENDIANNESS_LE
}
template <class T>
......@@ -122,9 +123,10 @@ static inline T toLeEndianByType(T value)
{
#if ENDIANNESS_LE
return value;
#endif
#else // ENDIANNESS_LE
toLeEndian(&value, sizeof(T));
return value;
#endif // ENDIANNESS_LE
}
} // namespace logmessage
......
......@@ -481,7 +481,9 @@ struct TableMetaInfo : public MetaInfo {
m_tblMetaHeader = (TableMetaHeader*)m_header;
size_t colCount = m_tblMetaHeader->m_colCount;
size_t dataSize = m_tblMetaHeader->m_colsSize;
if (m_data.getRealSize() + dataSize > size)
const size_t maxColCount = 5120;
if (m_data.getRealSize() + dataSize > size ||
colCount > maxColCount)
return -11;
// parse col meta
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册