chaokunyang commented on code in PR #3434:
URL: https://github.com/apache/fory/pull/3434#discussion_r2867312639


##########
dart/packages/fory/lib/src/serializer/collection/map/map_serializer.dart:
##########
@@ -52,10 +52,9 @@ abstract base class MapSerializer<T extends Map<Object?, 
Object?>>
   @override
   T read(ByteReader br, int refId, DeserializationContext pack) {
     int remaining = br.readVarUint32Small7();
-    final int? maxCollectionSize = pack.config.maxCollectionSize;
-    if (maxCollectionSize != null && remaining > maxCollectionSize) {
-      throw DeserializationSizeException(
-          'Collection', remaining, maxCollectionSize);
+    if (remaining > pack.config.maxCollectionSize) {
+      throw InvalidDataException(
+          'Collection size $remaining exceeds limit 
${pack.config.maxCollectionSize}');

Review Comment:
   Please refine thev error message, to tell user either the inout data is 
malicouse , or user need to increase maxCollectionSize or maxBinarySize when 
creating Fory. ditto for other InvalidDataException construction



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to