viirya commented on code in PR #8009:
URL: https://github.com/apache/arrow-rs/pull/8009#discussion_r2237865740


##########
arrow-array/src/ffi.rs:
##########
@@ -408,7 +408,17 @@ impl ImportedArrowArray<'_> {
             .map(|index| {
                 let len = self.buffer_len(index, variadic_buffer_lens, 
&self.data_type)?;
                 match unsafe { create_buffer(self.owner.clone(), self.array, 
index, len) } {
-                    Some(buf) => Ok(buf),
+                    Some(buf) => {
+                        // External libraries may use a dangling pointer for a 
buffer with length 0.
+                        // We respect the array length specified in the C Data 
Interface. Actually,

Review Comment:
   I just wanted to say that if there is a question on if the length is zero, 
but the pointer isn't a dangling pointer. Previously we simply take any 
non-null pointer as valid one and didn't consider the length. We ignored the 
possibility of a dangling pointer.



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