linzch3 opened a new pull request, #12065:
URL: https://github.com/apache/arrow-rs/pull/12065

   # Which issue does this PR close?
   
   - Closes #11689.
   
   # Rationale for this change
   
   A corrupt FIXED_LEN_BYTE_ARRAY column with a dictionary index past the end 
of the dictionary panics with a slice-out-of-range error instead of returning a 
`ParquetError`.
   
   # What changes are included in this PR?
   
   In the dictionary path of the FLBA `ValueDecoder::read`, each key is checked 
against the number of dictionary entries before slicing. The error message is 
the same one `RleDecoder::get_batch_with_dict` already uses for other types. 
Negative keys become huge values after `as usize`, so the same check catches 
them.
   
   AI disclosure: the fix and test were prepared with an AI coding assistant 
(Grok Bot). The test was run locally with and without the fix.
   
   # Are these changes tested?
   
   Yes. `test_dictionary_index_out_of_bounds` builds a 2-entry FLBA dictionary 
and an RLE page that refers to index 2. It panicked before this change and now 
returns the error.
   
   # Are there any significant user-facing changes?
   
   No.
   


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