scovich commented on issue #7784:
URL: https://github.com/apache/arrow-rs/issues/7784#issuecomment-3006883451

   > ```rust
   > // this call below will panic! This is because `field_name` internally 
calls
   > // `try_field_name`, which will err with the following: 
   > // validation error after construction: InvalidArgumentError("Tried to 
extract byte(s) 302..303 from 18-byte buffer")
   > let res = variant_object.field_name(300); // 300 is definitely out of 
bounds
   > ```
   
   And herein lies the danger of making those methods "infallible" -- if they 
ever use any code the iterator pass in the constructor did not exercise, they 
risk a panic. Here I would assume we need a bounds check in the `field_name` 
method, to ensure the `try_field_name` call only receives arguments the 
iterator validated.


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