-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 1.8.3
-
Component/s: None
-
Environment:.NET Framework 4.5.1, ASP.NET MVC 5, Windows 8.1
-
Minor Change
When passing an empty dictionary key of type string, the serializer breaks inside the CheckElementName method (BsonWriter.cs)
The bug is thrown because the code tries to access the zero index of string-char array. As the string is empty, there is no indexes for the char array.
I suggest a verification of the element name to test if it is empty, and if it is, throw the BsonSerializationException with a proper message.
I can contribute to this bug resolution in GitHub if I will be authorized.
Thank you all.
(See attachments for a better analysis)
- duplicates
-
CSHARP-893 MongoDB.Bson.Serialization.Serializers.DictionarySerializer do not support empty string as key when CheckElementNames is true
- Closed