hubgeter commented on code in PR #69682:
URL: https://github.com/apache/doris/pull/69682#discussion_r4412056790
##########
be/src/core/data_type/data_type_nullable.cpp:
##########
@@ -145,7 +200,39 @@ char* DataTypeNullable::serialize(const IColumn& column,
char* buf, int be_exec_
const char* DataTypeNullable::deserialize(const char* buf, MutableColumnPtr*
column,
int be_exec_version) const {
+ return deserialize(buf, nullptr, column, be_exec_version);
+}
+
+const char* DataTypeNullable::deserialize(const char* buf, const char* end,
Review Comment:
Fixed in f17eb83b138bfae9ece0fbc02fc196a8bc5e9a30. Both nullable wire
layouts now call the four-argument child deserializer with the original buffer
end, so the HLL decoder retains its bounds checks. Added truncated nullable-HLL
cases for missing child headers, length arrays and FULL payload bytes, plus
const/empty round trips. Both production files compiled in DEBUG and the
focused DEBUG safety checks passed; the full focused BE UT build is still
running.
##########
be/src/core/data_type/data_type_nullable.cpp:
##########
@@ -182,17 +294,37 @@ const char* DataTypeNullable::deserialize(const char*
buf, MutableColumnPtr* col
// row num
uint32_t mem_size = unaligned_load<uint32_t>(buf);
buf += sizeof(uint32_t);
+ size_t encode_size = 0;
+ if (end != nullptr) {
+ size_t remaining = static_cast<size_t>(end - buf);
+ if (mem_size > remaining) {
Review Comment:
Fixed in f17eb83b138bfae9ece0fbc02fc196a8bc5e9a30. The legacy raw-size check
now applies only to uncompressed maps; compressed maps continue through the
encoded-length/control-byte validator. Added parameterized legacy/current
Nullable(TINYINT) round trips for 257, 512 and 513 rows, covering zero flags,
all four StreamVByte widths and partial tails. The all-zero case asserts that
the complete encoded PBlock is smaller than its uncompressed null map. Added
malformed encoded-length/control/padding cases as well. The focused DEBUG BE UT
build is still running.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]