kevin-montrose / Jil

Fast .NET JSON (De)Serializer, Built On Sigil
MIT License
2.15k stars 253 forks source link

JSON.DeserializeDynamic throws ArgumentException #316

Closed Metalnem closed 5 years ago

Metalnem commented 5 years ago

JSON.DeserializeDynamic throws an ArgumentException when deserializing the file from the attached archive. You can run the following code to reproduce it (the path variable should contain the path to the extracted file):

using (var file = File.OpenText(path))
{
  JSON.DeserializeDynamic(file);
}

Found via SharpFuzz.

Tornhoof commented 5 years ago

Your input file has the member pop twice, as stated in the exception (duplicate Key) and according to https://tools.ietf.org/html/rfc8259#section-4 this behaviour is undefined.

Metalnem commented 5 years ago

Yes, but in all other scenarios Jil throws DeserializationException, so I would expect it to either not throw, or throw DeserializationException, not ArgumentException.