bit2swaz commented on issue #10575:
URL: https://github.com/apache/arrow-rs/issues/10575#issuecomment-5246242505

   confirmed. 
[`fb_to_schema`](https://github.com/apache/arrow-rs/blob/bf34445fa2030caceb63beb56d2f30473864c3a0/arrow-ipc/src/convert.rs#L194-L196)
 opens with `fb.fields().unwrap()` and `fields` is optional in the flatbuffer 
schema so a message the verifier accepts aborts the process. same problem runs 
deeper thru 
[`get_data_type`](https://github.com/apache/arrow-rs/blob/bf34445fa2030caceb63beb56d2f30473864c3a0/arrow-ipc/src/convert.rs#L294):
 the [unknown float 
precision](https://github.com/apache/arrow-rs/blob/bf34445fa2030caceb63beb56d2f30473864c3a0/arrow-ipc/src/convert.rs#L349)
 and [`Type 
NONE`](https://github.com/apache/arrow-rs/blob/bf34445fa2030caceb63beb56d2f30473864c3a0/arrow-ipc/src/convert.rs#L509)
 cases you flagged + the rest of the `unwrap()`s
   
   the `try_` wrappers only handle the outer parse then `.map(fb_to_schema)` so 
they dont cover it. parquet decodes the footer's `ARROW:schema` key through 
[the same 
call](https://github.com/apache/arrow-rs/blob/bf34445fa2030caceb63beb56d2f30473864c3a0/parquet/src/arrow/schema/mod.rs#L272)
 so an untrusted `.parquet` can abort too. arrow-flight calls `fb_to_schema` 
directly as well
   
   your non breaking shape makes sense too: make `get_data_type` return 
`Result` (already `pub(crate)`), add a public `try_fb_to_schema`, switch 
readers/parquet/flight onto it, keep `fb_to_schema` and the 
`From<crate::Field>` impl as panicking delegates for compat
   
   happy to take this one if nobodys started :)
   
   does the `try_fb_to_schema` route sound good, and is a patch/minor release 
fine for it?
   


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