wgtmac opened a new pull request, #55732:
URL: https://github.com/apache/arrow/pull/55732

   ### Rationale for this change
   
   Appending a default `std::string_view` to a `BufferBuilder` is UB because it 
can pass the null pointer to `memcpy`.
   
   ### What changes are included in this PR?
   
   `BufferBuilder::UnsafeAppend` now returns immediately when the length is 
zero. Both `Append` and `UnsafeAppend` use this path.
   
   ### Are these changes tested?
   
   Extended `TestBufferBuilder.FinishEmpty` to cover appending an empty view 
before and after reserving capacity.
   
   ### Are there any user-facing changes?
   
   No.
   
   ### Was AI used for this PR?
   
   **PR code and description written by:**
   
   - [x] Human
   - [x] AI
   
   **Reviewed before submission by:**
   
   - [x] Human
   - [ ] AI
   - [ ] Not reviewed


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