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

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

commit c3b93fd73517bafa8914cf25ceb8aef36ef186cf
Author: Xinyi Zou <[email protected]>
AuthorDate: Fri Feb 10 08:48:12 2023 +0800

    [fix](memory) Fix parquet load stack overflow (#16537)
---
 be/src/vec/exec/format/parquet/parquet_thrift_util.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/be/src/vec/exec/format/parquet/parquet_thrift_util.h 
b/be/src/vec/exec/format/parquet/parquet_thrift_util.h
index 5811f034bd..b8be080d94 100644
--- a/be/src/vec/exec/format/parquet/parquet_thrift_util.h
+++ b/be/src/vec/exec/format/parquet/parquet_thrift_util.h
@@ -56,11 +56,11 @@ static Status parse_thrift_footer(FileReader* file, 
std::shared_ptr<FileMetaData
     }
     tparquet::FileMetaData t_metadata;
     // deserialize footer
-    uint8_t meta_buff[metadata_size];
+    std::unique_ptr<uint8_t[]> meta_buff(new uint8_t[metadata_size]);
     RETURN_IF_ERROR(file->readat(file_size - PARQUET_FOOTER_SIZE - 
metadata_size, metadata_size,
-                                 &bytes_read, meta_buff));
+                                 &bytes_read, meta_buff.get()));
     DCHECK_EQ(bytes_read, metadata_size);
-    RETURN_IF_ERROR(deserialize_thrift_msg(meta_buff, &metadata_size, true, 
&t_metadata));
+    RETURN_IF_ERROR(deserialize_thrift_msg(meta_buff.get(), &metadata_size, 
true, &t_metadata));
     file_metadata.reset(new FileMetaData(t_metadata));
     RETURN_IF_ERROR(file_metadata->init_schema());
     return Status::OK();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to