WillAyd commented on code in PR #595:
URL: https://github.com/apache/arrow-nanoarrow/pull/595#discussion_r1735342676
##########
src/nanoarrow/common/inline_buffer.h:
##########
@@ -291,6 +291,10 @@ static inline ArrowErrorCode ArrowBufferAppendFill(struct
ArrowBuffer* buffer,
uint8_t value, int64_t
size_bytes) {
NANOARROW_RETURN_NOT_OK(ArrowBufferReserve(buffer, size_bytes));
+ if (size_bytes == 0) {
+ return NANOARROW_OK;
+ }
+
memset(buffer->data + buffer->size_bytes, value, size_bytes);
Review Comment:
The UB was triggered by the fact that we were making a call of `memset(NULL,
..., 0)` - the fact that `size_bytes` was 0 I don't think prevents UB from
occurring when the `dst` is NULL
--
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]