PlenoraETL opened a new pull request, #11020:
URL: https://github.com/apache/arrow-rs/pull/11020
# Which issue does this PR close?
Closes #11019.
# Rationale for this change
`DictionaryBatch.data` is optional in the flatbuffer grammar and required by
the format. `get_dictionary_values` opened it with `unwrap`, so a file that
omits it panicked instead of producing an `ArrowError`.
This is the same class of field, in the same file, that the footer's custom
metadata was just fixed for:
```rust
let (Some(key), Some(value)) = (kv.key(), kv.value()) else {
return Err(ArrowError::ParseError(
"Custom metadata in the IPC footer is missing a key or a
value".to_string(),
));
};
```
The patch uses that shape. The proposal is essentially "finish the round".
A panic matters more than usual on this path: under `libfuzzer-sys` a caught
panic still becomes `abort()` before unwinding, so a fuzz target reading
untrusted IPC goes into quarantine rather than reporting a rejected input.
# What changes are included in this PR?
One `let ... else` in `get_dictionary_values`, plus a regression test.
Measured before and after on `main`: the fixture panics without the change
and returns `Parser error: Dictionary batch is missing its data` with it.
`cargo test -p arrow-ipc` passes — 132, 7 and 11.
# Are these changes tested?
Yes. The fixture is the original 2169-byte input from the fuzzing corpus of
[plenora-IO-tools](https://github.com/PlenoraETL/plenora-IO-tools), not a
reduced one, added under `arrow-ipc/test/data/`.
# Are there any user-facing changes?
A file that used to panic now returns an `ArrowError::ParseError`. No API
change.
--
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]