martin-g commented on code in PR #3527:
URL: https://github.com/apache/avro/pull/3527#discussion_r2465629453


##########
lang/c/src/datum.c:
##########
@@ -156,7 +156,7 @@ static avro_datum_t avro_bytes_private(char *bytes, int64_t 
size,
 avro_datum_t avro_bytes(const char *bytes, int64_t size)
 {
        char *bytes_copy = (char *) avro_malloc(size);
-       if (!bytes_copy) {
+       if (!bytes_copy && size) {

Review Comment:
   What would happen now if `size` is `0`?
   It looks to me that no matter what is the value of `bytes_copy` it will 
never enter the `if` and it will call `memcpy(bytes_copy, bytes, 0)`



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