Skip to content

MINOR: [C++][Parquet] Reject too-short statistics values in FormatStatValue#50025

Open
jmestwa-coder wants to merge 1 commit into
apache:mainfrom
jmestwa-coder:stat-value-short-bound
Open

MINOR: [C++][Parquet] Reject too-short statistics values in FormatStatValue#50025
jmestwa-coder wants to merge 1 commit into
apache:mainfrom
jmestwa-coder:stat-value-short-bound

Conversation

@jmestwa-coder
Copy link
Copy Markdown

FormatStatValue in cpp/src/parquet/types.cc memcpys sizeof(physical_type) bytes from a string_view that comes straight out of the Thrift statistics block, so a crafted file with min_value or max_value shorter than the column's width (for example, a zero-byte stat on an INT96 column) reads past the buffer. The check belongs in this callee since callers in printer.cc just forward whatever the metadata holds. New ASSERT_THROW coverage in types_test.cc exercises the short-value paths for BOOLEAN, INT32, INT64, FLOAT, DOUBLE, INT96, Decimal and Float16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant