-Fixed overflow when converting incomplete JSON to XML

This commit is contained in:
James Newton-King
2017-04-22 11:13:28 +12:00
parent ec8949ca40
commit 822c3f00dd
3 changed files with 21 additions and 114 deletions
@@ -916,6 +916,16 @@ namespace Newtonsoft.Json.Tests.Converters
Assert.AreEqual(doc.InnerXml, deserializedDoc.InnerXml);
}
[Test]
public void FailOnIncomplete()
{
string json = @"{'Row' : ";
ExceptionAssert.Throws<JsonSerializationException>(
() => JsonConvert.DeserializeXmlNode(json, "ROOT"),
"Unexpected end when reading JSON. Path 'Row', line 1, position 9.");
}
[Test]
public void DocumentDeserialize()
{