YichiZhang0613 opened a new issue, #7174:
URL: https://github.com/apache/arrow-rs/issues/7174

   In arrow-rs-master/arrow-data/src/ffi.rs, the code panics when index < 
self.num_buffers(), while the comment indicates that code will panic when index 
<= self.num_buffers().
   
   ```rust
   /// # Panic
       /// Panics if index exceeds the number of buffers or the buffer is not 
correctly aligned
       #[inline]
       pub fn buffer(&self, index: usize) -> *const u8 {
           assert!(!self.buffers.is_null());
           assert!(index < self.num_buffers());
           // SAFETY:
           // If buffers is not null must be valid for reads up to num_buffers
           unsafe { std::ptr::read_unaligned((self.buffers as *mut *const 
u8).add(index)) }
       }
   ```


-- 
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: github-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to