gty404 opened a new pull request, #1022:
URL: https://github.com/apache/iceberg-cpp/pull/1022
## Summary
- `DecodeStructToBuilder` cached the Avro-field-index to projection-index
mapping keyed on `projections.data()` only. All empty-struct projections share
the same (null) `data()`, so a second empty struct with more Avro fields reused
a cached vector sized for the first one and read out of bounds, which could end
in a wild-pointer dispatch via `StructBuilder::field_builder`.
- The cache key is now `{projections.data(), avro_node}`. The mapping is
built and validated before being cached, and a projected field index outside
the Avro record's field count returns `InvalidArgument`.
## Test plan
- [x] New `AvroReaderTest.ProjectEmptyStructsOfDifferentWidths`: file with
two struct columns of 1 and 6 fields, both read back as empty structs through
the direct decoder
- [x] Test crashes (SIGSEGV) without the fix and passes with it
- [x] Full `avro_test` suite passes (196 tests)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]