iemejia commented on code in PR #3860:
URL: https://github.com/apache/avro/pull/3860#discussion_r3565199659


##########
lang/csharp/src/apache/main/Generic/GenericReader.cs:
##########
@@ -490,8 +496,12 @@ protected virtual object ReadMap(object reuse, MapSchema 
writerSchema, Schema re
         {
             MapSchema rs = (MapSchema)readerSchema;
             object result = CreateMap(reuse, rs);
-            for (int n = (int)d.ReadMapStart(); n != 0; n = 
(int)d.ReadMapNext())
+            // Map keys are strings (>= 1 byte length prefix) plus the value.
+            int minBytes = 1 + MinBytesPerElement(writerSchema.ValueSchema);
+            for (long nl = d.ReadMapStart(); nl != 0; nl = d.ReadMapNext())

Review Comment:
   Fixed in 7376905: both the array and map minima are computed as long (1L + 
...) and EnsureCollectionAvailable takes a long, so 1 + int.MaxValue no longer 
overflows to a negative value that would disable the map check.



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