github-actions[bot] commented on code in PR #63702:
URL: https://github.com/apache/doris/pull/63702#discussion_r3305449505


##########
be/src/core/column/column_complex.h:
##########
@@ -70,7 +70,7 @@ class ColumnComplexType final : public COWHelper<IColumn, 
ColumnComplexType<T>>
         }
 
         if constexpr (T == TYPE_BITMAP) {
-            pvalue->deserialize(pos);

Review Comment:
   This newly bounded decode can fail, but `insert_binary_data` has already 
inserted a default value and then ignores the `false` return. A malformed 
bitmap binary cell will therefore stay in the column as an empty/default bitmap 
rather than making the load/read fail, which violates the hardening goal and 
can silently corrupt query results. Please check the return value and 
throw/propagate an error before leaving the inserted value in place.



##########
be/src/core/data_type/data_type_bitmap.cpp:
##########
@@ -90,8 +90,9 @@ const char* DataTypeBitMap::deserialize(const char* buf, 
MutableColumnPtr* colum
     const auto* meta_ptr = reinterpret_cast<const size_t*>(buf);
     const char* data_ptr = buf + sizeof(size_t) * real_have_saved_num;
     for (size_t i = 0; i < real_have_saved_num; ++i) {
-        data[i].deserialize(data_ptr);
-        data_ptr += unaligned_load<size_t>(&meta_ptr[i]);
+        size_t one_size = unaligned_load<size_t>(&meta_ptr[i]);
+        data[i].deserialize(data_ptr, one_size);
+        data_ptr += one_size;

Review Comment:
   `BitmapValue::deserialize` now returns `false` for truncated or malformed 
input, but this block deserialization path still ignores that result. If a 
serialized block carries a bad bitmap payload, `data[i]` remains 
default/partially initialized and the reader advances by the declared size, so 
execution can continue with wrong bitmap values instead of failing. Please 
check the return value here and raise/propagate an error; the same applies to 
`deserialize_as_stream` below, which currently ignores 
`value.deserialize(ref.data, ref.size)` as well.



-- 
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]

Reply via email to