Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Metalnem opened this issue Dec 24, 2018 · 0 comments


Copy link

@Metalnem Metalnem commented Dec 24, 2018

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:

  • ArgumentNullException
  • ArgumentException
  • FormatException
  • IndexOutOfRangeException
  • InvalidOperationException

You can run the following code to reproduce it (the path variable should contain the path to one of the extracted files):

using (var file = File.OpenRead(path))

Found via SharpFuzz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant