bit2swaz opened a new pull request, #10744: URL: https://github.com/apache/arrow-rs/pull/10744
# Which issue does this PR close? - Closes #10663 # Rationale for this change `FileReaderBuilder::build` read the footer's schema with [`footer.schema().unwrap()`](https://github.com/bit2swaz/arrow-rs/blob/93180c87b97fe0b19cd4b84fdef6839230a01400/arrow-ipc/src/reader.rs#L1253). the schema table is optional in the footer flatbuffer, so an IPC file whose footer verifies but has no schema table makes that `unwrap()` panic instead of returning an error. the flatbuffer verifier accepts such a file, so this is reachable from untrusted input this is the same class of untrusted-input panic as #10437 and #10575. those two are in `convert.rs` and #10647 made them fallible, but this sink is one level up in `reader.rs` where the footer's schema table is absent, so #10647 leaves it alone # What changes are included in this PR? swap the `unwrap()` for `ok_or_else(...)?` returning an `ArrowError::ParseError`, matching the `recordBatches` check right above it # Are these changes tested? yes. added `test_missing_footer_schema_error` which builds a footer that verifies but has no schema table and checks `FileReader::try_new` returns `Err` instead of panicking # Are there any user-facing changes? reading a malformed IPC file with no footer schema now returns an `ArrowError` instead of panicking. no API changes -- 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]
