This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 2292a69cf4f [Fix](parquet-reader) Fix parquet reader crash in 
set_dict().  (#41307)
2292a69cf4f is described below

commit 2292a69cf4fc2ae77a32c87c8c8bf1a833c7cedc
Author: Qi Chen <kaka11.c...@gmail.com>
AuthorDate: Thu Sep 26 17:02:00 2024 +0800

    [Fix](parquet-reader) Fix parquet reader crash in set_dict().  (#41307)
    
    ## Proposed changes
    
    Backport #40643
---
 be/src/vec/exec/format/parquet/byte_array_dict_decoder.cpp | 3 +++
 be/src/vec/exec/format/parquet/fix_length_dict_decoder.hpp | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/be/src/vec/exec/format/parquet/byte_array_dict_decoder.cpp 
b/be/src/vec/exec/format/parquet/byte_array_dict_decoder.cpp
index 8b9532e68d0..7c3d15b7c21 100644
--- a/be/src/vec/exec/format/parquet/byte_array_dict_decoder.cpp
+++ b/be/src/vec/exec/format/parquet/byte_array_dict_decoder.cpp
@@ -32,6 +32,9 @@ namespace doris::vectorized {
 Status ByteArrayDictDecoder::set_dict(std::unique_ptr<uint8_t[]>& dict, 
int32_t length,
                                       size_t num_values) {
     _dict = std::move(dict);
+    if (_dict == nullptr) {
+        return Status::Corruption("Wrong dictionary data for byte array type, 
dict is null.");
+    }
     _dict_items.reserve(num_values);
     uint32_t offset_cursor = 0;
     char* dict_item_address = reinterpret_cast<char*>(_dict.get());
diff --git a/be/src/vec/exec/format/parquet/fix_length_dict_decoder.hpp 
b/be/src/vec/exec/format/parquet/fix_length_dict_decoder.hpp
index 65e329ae89b..3024405c295 100644
--- a/be/src/vec/exec/format/parquet/fix_length_dict_decoder.hpp
+++ b/be/src/vec/exec/format/parquet/fix_length_dict_decoder.hpp
@@ -107,6 +107,9 @@ protected:
             return Status::Corruption("Wrong dictionary data for fixed length 
type");
         }
         _dict = std::move(dict);
+        if (_dict == nullptr) {
+            return Status::Corruption("Wrong dictionary data for byte array 
type, dict is null.");
+        }
         char* dict_item_address = reinterpret_cast<char*>(_dict.get());
         _dict_items.resize(num_values);
         _dict_value_to_code.reserve(num_values);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to