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

   # Which issue does this PR close?
   
   - Closes #9796 .
   
   # Rationale for this change
   
   Currently, `DeltaByteArrayDecoder::get` assumes prefix lengths are always 
valid and directly slices `previous_value`. Invalid prefix lengths (negative or 
exceeding previous value length) can cause a panic instead of returning an 
error.
   
   # What changes are included in this PR?
   
   * Add validation for decoded prefix lengths:
   
     * reject negative values
     * reject values exceeding `previous_value.len()`
   * Return `Err` instead of panicking on invalid input
   * Add a regression test using corrupted encoded data
   
   # Are these changes tested?
   
   Yes.
   
   * Added `test_delta_byte_array_invalid_prefix_len_returns_error`
   * Test:
   
     * encodes valid data
     * corrupts prefix-length stream
     * verifies decoder returns `Err` (previously panicked)
   * All the other existing tests pass
   
   # Are there any user-facing changes?
   
   No.
   
   * No API changes
   * Only improves error handling for invalid input


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