From 320cbfc818984b69b6f35039db53f6ad7a8ac47a Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Wed, 2 Sep 2026 14:40:02 +0800 Subject: [PATCH] GH-51135: [C++][Parquet] Avoid misaligned stores when reading BYTE_ARRAY decimals --- cpp/src/parquet/arrow/reader_internal.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cpp/src/parquet/arrow/reader_internal.cc b/cpp/src/parquet/arrow/reader_internal.cc index 12f36fe39cf8..b5207aca253f 100644 --- a/cpp/src/parquet/arrow/reader_internal.cc +++ b/cpp/src/parquet/arrow/reader_internal.cc @@ -725,9 +725,7 @@ struct DecimalConverter { return Status::Invalid("Invalid BYTE_ARRAY length for ", type->ToString()); } - auto out_ptr_view = reinterpret_cast(out_ptr); - out_ptr_view[0] = 0; - out_ptr_view[1] = 0; + std::memset(out_ptr, 0, type_length); // only convert rows that are not null if there are nulls, or // all rows, if there are not