[CSHARP-880] System.IndexOutOfRange Exception in Check Created: 17/Dec/13 Updated: 20/Mar/14 Resolved: 20/Mar/14 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.8.3 |
| Fix Version/s: | 1.9 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Gustavo Gondim | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | bsonwriter | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
.NET Framework 4.5.1, ASP.NET MVC 5, Windows 8.1 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Minor Change | ||||||||
| Description |
|
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) |