Reranko05 opened a new pull request, #50234:
URL: https://github.com/apache/arrow/pull/50234

   ### Rationale for this change
   
   `rb_memory_view_get()` callers may pass a non-zero-initialized 
`rb_memory_view_t`. `primitive_array_get()` and `buffer_get()` did not 
initialize `item_desc.components` and `item_desc.length`, which could cause 
`rb_memory_view_release()` to attempt to free an invalid pointer and abort the 
process.
   
   ### What changes are included in this PR?
   
   This change initializes `item_desc.components` and `item_desc.length` in 
both `primitive_array_get()` and `buffer_get()`.
   
   It also adds regression tests that verify releasing a memory view with a 
non-zero-initialized `rb_memory_view_t` does not crash for both 
`Arrow::Int32Array` and `Arrow::Buffer`.
   
   ### Are these changes tested?
   
   Yes. Added regression tests in `test-memory-view.rb` that reproduced the 
crash before this change and pass after the fix.
   
   ### Are there any user-facing changes?
   
   No.
   
   **This PR contains a "Critical Fix".**
   
   This change fixes a crash that could occur when `rb_memory_view_release()` 
is called with a memory view whose `item_desc` members were not initialized.


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