avro-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [avro] thiru-mg commented on a change in pull request #1153: AVRO-3051: C++ Reader and writers modernized
Date Wed, 24 Mar 2021 08:36:32 GMT

thiru-mg commented on a change in pull request #1153:
URL: https://github.com/apache/avro/pull/1153#discussion_r600269932



##########
File path: lang/c++/api/Serializer.hh
##########
@@ -71,15 +68,15 @@ class Serializer : private boost::noncopyable
     }
 
     void writeBytes(const void *val, size_t size) {
-        writer_.writeBytes(val);
+        writer_.writeBytes(val, size);

Review comment:
       This is indeed a bug. The only caller for `writeBytes` is `serialize` in `AvroSerializer.hh`.
`serialize` is not used by any of the code here, but could be used by some of generated code.
Without this fix, the code can crash because there is no guarantee that the string is null-terminated.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message