From 872324cb00996cb5dc8c7a2f85455e0056d2965c Mon Sep 17 00:00:00 2001 From: Matt Topol Date: Mon, 1 Jul 2024 13:04:26 -0400 Subject: [PATCH] handle bad index --- cpp/src/arrow/ipc/writer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/arrow/ipc/writer.cc b/cpp/src/arrow/ipc/writer.cc index 88d66a1a9a010..f603e60c66555 100644 --- a/cpp/src/arrow/ipc/writer.cc +++ b/cpp/src/arrow/ipc/writer.cc @@ -461,7 +461,7 @@ class RecordBatchSerializer { auto data = array.value_data(); int64_t total_data_bytes = 0; - if (value_offsets) { + if (value_offsets && array.length() > 0) { offset_type last_offset_value; RETURN_NOT_OK(MemoryManager::CopyBufferSliceToCPU( value_offsets, array.length() * sizeof(offset_type), sizeof(offset_type),