Commits


Dan Stone authored and GitHub committed 37935604bf1
GH-38242: [Java] Fix incorrect internal struct accounting for DenseUnionVector#getBufferSizeFor (#38305) ### What changes are included in this PR? Fix incorrect implementation of `DenseUnionVector.getBufferSizeFor`. Sum the type id counts before calling `getBufferSizeFor` on the union's child vectors. ### Are these changes tested? Yes. A test verifies the OOB read (requires bounds check), and an example count is correct, fails as expected before fix. **This PR contains a "Critical Fix".** For users of DenseUnionVector the size can calculated incorrectly, as well as cause of out-of-bounds buffer reads which may return garbage (or potentially segfaulting) if bounds checking is off. * Closes: #38242 Authored-by: Dan Stone <wotbrew@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>