neuecc / Utf8Json

Definitely Fastest and Zero Allocation JSON Serializer for C#(NET, .NET Core, Unity, Xamarin).
MIT License
2.36k stars 267 forks source link

JsonSerializer.Deserialize<dynamic> can throw many unexpected exceptions #142

Open Metalnem opened 5 years ago

Metalnem commented 5 years ago

In most cases, JsonSerializer throws JsonParsingException when encountering a malformed input. However, JsonSerializer.Deserialize can also throw many unexpected exceptions when deserializing files from the attached archive. These are:

using (var file = File.OpenRead(path))
{
  JsonSerializer.Deserialize<dynamic>(file);
}

Found via SharpFuzz.