Views
No views yet
StringDirectColumnReader::computeSize() in ColumnReader.cc:697 casts int64_t string lengths to size_t without validating for negative values.isSigned=false) but stored into int64_t* arrays. When a crafted .orc file encodes a length >= 2^63, the value becomes a negative int64_t. static_cast<size_t>(negative) produces a huge positive value near SIZE_MAX.1// ColumnReader.cc:691-706
2size_t totalLength = 0;
3for (size_t i = 0; i < numValues; ++i) {
4 totalLength += static_cast<size_t>(lengths[i]); // NO NEGATIVE CHECK!
5}
6// ...
7byteBatch.blob.resize(totalLength); // OOM or undersizedblob.resize(9.2 exabytes) → crashptr += negative_length → OOB readReader.cc:591 — uint64 addition overflow, no checked arithmeticif (lengths[i] < 0) throw ParseError(...) before the cast.