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

   Resolves #50308
   
   ### Rationale for this change
   `SparseCSFIndex::Make` currently lacks validation for input vector sizes. 
This can lead to out-of-bounds memory access when provided with inconsistent 
input lengths. This PR adds the necessary checks to ensure that input is valid 
before object construction.
   
   ### What changes are included in this PR?
   - Input validation in `SparseCSFIndex::Make` to verify `axis_order` is 
nonzero and `indices_shapes`, `indptr_data`, `indices_data` have consistent 
dimensions.
   - A unit test to verify `Status::Invalid` is returned when inputs are 
mismatched.
   ### Are these changes tested?
   Yes, `cpp/src/arrow/sparse_tensor_test.cc` now contains 
`TEST(TestSparseCSFIndex, Make)`, which triggers the validation logic.
   ### Are there any user-facing changes?
   No.
   
   **This PR contains a "Critical Fix".**
   This fixes a bug that causes a segfault when invalid input parameters are 
passed to `SparseCSFIndex::Make`.
   
   **AI Usage:**
   AI was used to navigate the codebase and set up the build environment.


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