Impala Public Jenkins has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/24892 )

Change subject: IMPALA-15377: Fix ASAN heap-buffer-overflow in 
ParquetDeltaEncoder for empty pages
......................................................................

IMPALA-15377: Fix ASAN heap-buffer-overflow in ParquetDeltaEncoder for empty 
pages

ParquetDeltaEncoder::FinalizePage() unconditionally wrote a page header
even when zero values had been written (total_value_count_ == 0), using an
uninitialized first_value_ and requiring more space than WorstCaseOutputSize(0)
(which returns 0) reserves. This caused a heap-buffer-overflow write in
BitWriter::PutAligned via WriteHeader, hit by
ParquetDeltaLengthByteArrayDecoderTest.EmptyPage on ASAN builds.

Make FinalizePage() return 0 immediately for an empty page instead of writing
a header, matching the WorstCaseOutputSize(0) == 0 contract.

Change-Id: I52aaff63ab76dd25ceeb6a7d840d4c483cf518b1
Assisted-by: Claude Sonnet 5 (GitHub Copilot)
Reviewed-on: http://gerrit.cloudera.org:8080/24892
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
M be/src/exec/parquet/parquet-delta-encoder.cc
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

--
To view, visit http://gerrit.cloudera.org:8080/24892
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I52aaff63ab76dd25ceeb6a7d840d4c483cf518b1
Gerrit-Change-Number: 24892
Gerrit-PatchSet: 3
Gerrit-Owner: Michael Smith <[email protected]>
Gerrit-Reviewer: Daniel Becker <[email protected]>
Gerrit-Reviewer: Daniel Vanko <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Jiyoung Yoo <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Mihaly Szjatinya <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>

Reply via email to