Skip to content

Commit 122177c

Browse files
committed
apacheGH-49477: [C++][Parquet] Fix multiplication overflow in PLAIN BYTE_ARRAY decoder
1 parent 5f12de2 commit 122177c

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

ci/scripts/cpp_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ if [ "${ARROW_FUZZING}" == "ON" ]; then
222222
"${binary_output_dir}/arrow-ipc-tensor-stream-fuzz" arrow-ipc-tensor-stream/*-testcase-*
223223
if [ "${ARROW_PARQUET}" == "ON" ]; then
224224
"${binary_output_dir}/parquet-arrow-fuzz" parquet/fuzzing/*-testcase-*
225-
# TODO replay encoding regression files when we have some
225+
"${binary_output_dir}/parquet-encoding-fuzz" parquet/encoding-fuzzing/*-testcase-*
226226
fi
227227
"${binary_output_dir}/arrow-csv-fuzz" csv/fuzzing/*-testcase-*
228228
popd

cpp/src/parquet/decoder.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,8 @@ class PlainByteArrayDecoder : public PlainDecoder<ByteArrayType> {
759759
// We're going to decode `num_values - null_count` PLAIN values,
760760
// and each value has a 4-byte length header that doesn't count for the
761761
// Arrow binary data length.
762-
int64_t estimated_data_length = len_ - 4 * (num_values - null_count);
762+
int64_t estimated_data_length =
763+
len_ - 4 * static_cast<int64_t>(num_values - null_count);
763764
if (ARROW_PREDICT_FALSE(estimated_data_length < 0)) {
764765
return Status::Invalid("Invalid or truncated PLAIN-encoded BYTE_ARRAY data");
765766
}

0 commit comments

Comments
 (0)