bit2swaz opened a new issue, #10663:
URL: https://github.com/apache/arrow-rs/issues/10663

   ### Describe the bug
   
   `FileReaderBuilder` calls `footer.schema().unwrap()` at 
[reader.rs#L1252](https://github.com/apache/arrow-rs/blob/4f0c3c8e2084f8e75965e8fc3e37e8cef016d3e2/arrow-ipc/src/reader.rs#L1252).
 the footer's schema table is optional in the flatbuffer, so a malformed IPC 
file whose footer has no schema makes this panic instead of returning an error.
   
   the flatbuffer verifier accepts such a file, so this is reachable from 
untrusted input
   
   ### To Reproduce
   
   open an IPC file whose footer verifies but has no schema table, e.g. 
`FileReader::try_new(reader, None)` on those bytes. it aborts on the `unwrap()` 
rather than returning `Err`
   
   ### Expected behavior
   
   return an `ArrowError` describing the missing schema, the same way the other 
reader paths already handle malformed input
   
   ### Additional context
   
   this is the same class of untrusted input panic as #10437 and #10575, but on 
a different sink. those two are inside `convert.rs` (`get_data_type` and 
`fb_to_schema`) which #10647 makes fallible. this one is one level up in 
`reader.rs`, the footer's schema table being absent so #10647 leaves it alone
   
   split out as per @alamb's suggestion on #10647 to keep it as a separate issue
   
   the fix is small: swap the `unwrap()` for a `.ok_or_else(...)?` returning a 
parse error + a test
   
   ill pick this up once #10647 lands since it touches the same region of 
`reader.rs` and id rather not have the two changes conflict
   


-- 
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]

Reply via email to