Skip to content

MINOR: [C++][Parquet] Avoid size overflow in WKBBuffer::ReadCoords#50036

Open
jmestwa-coder wants to merge 1 commit into
apache:mainfrom
jmestwa-coder:wkb-readcoords-size-overflow
Open

MINOR: [C++][Parquet] Avoid size overflow in WKBBuffer::ReadCoords#50036
jmestwa-coder wants to merge 1 commit into
apache:mainfrom
jmestwa-coder:wkb-readcoords-size-overflow

Conversation

@jmestwa-coder
Copy link
Copy Markdown

WKBBuffer::ReadCoords computes the coordinate-sequence length as n_coords * sizeof(Coord) in size_t, where n_coords is a uint32 read straight from the WKB geometry bytes. On 32-bit targets such as wasm32 that product overflows, so the size_ check passes for a too-small buffer and the following ReadUnchecked loop walks off the end. Widening the multiplication to 64 bits keeps the bound correct everywhere; on 64-bit builds the comparison is unchanged.

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