mapleFU commented on code in PR #37360:
URL: https://github.com/apache/arrow/pull/37360#discussion_r1309919258


##########
cpp/src/arrow/compute/function_internal.cc:
##########
@@ -83,8 +83,10 @@ Result<std::unique_ptr<FunctionOptions>> 
GenericOptionsType::Deserialize(
 
 Result<std::unique_ptr<FunctionOptions>> DeserializeFunctionOptions(
     const Buffer& buffer) {
-  io::BufferReader stream(buffer);
-  ARROW_ASSIGN_OR_RAISE(auto reader, 
ipc::RecordBatchFileReader::Open(&stream));
+  // Copying the buffer here is not ideal, but we need to do it to avoid
+  // lifetime issues with the zero-copy buffer read.

Review Comment:
   Mentioned here 
https://github.com/apache/arrow/pull/37360#discussion_r1307628219
   
   Seems that `FunctionOptions` might cannot gurantee that it doesn't has 
`Buffer` member. And it might bound to `::arrow::Buffer`, which cause 
use-after-free. Should I make it more clear?



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