This is an automated email from the ASF dual-hosted git repository.

paleolimbot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-nanoarrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 8c558e56 chore: fix dead code on clone of zero size shared buffer 
(#746)
8c558e56 is described below

commit 8c558e5669f79ef6af681dc5fa07ca81f599e049
Author: Dewey Dunnington <[email protected]>
AuthorDate: Sat May 3 14:26:29 2025 -0500

    chore: fix dead code on clone of zero size shared buffer (#746)
    
    This in theory shouldn't happen because the outer code checks for a zero
    size specification from the IPC message header; however, we can at least
    make sure it is correct. (I didn't add a test because this is a static
    internal function).
    
    Closes #734.
---
 src/nanoarrow/ipc/decoder.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/nanoarrow/ipc/decoder.c b/src/nanoarrow/ipc/decoder.c
index 8012cd49..97649351 100644
--- a/src/nanoarrow/ipc/decoder.c
+++ b/src/nanoarrow/ipc/decoder.c
@@ -200,10 +200,8 @@ ArrowErrorCode ArrowIpcSharedBufferInit(struct 
ArrowIpcSharedBuffer* shared,
 
 static void ArrowIpcSharedBufferClone(struct ArrowIpcSharedBuffer* shared,
                                       struct ArrowBuffer* shared_out) {
-  if (shared->private_src.data == NULL) {
+  if (shared->private_src.size_bytes == 0) {
     ArrowBufferInit(shared_out);
-    shared_out->size_bytes = shared_out->size_bytes;
-    shared_out->capacity_bytes = shared_out->capacity_bytes;
     return;
   }
 

Reply via email to