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

Invalid input causing deserialize to never return #48

Closed
tanglebones opened this issue Apr 1, 2015 · 2 comments
Closed

Invalid input causing deserialize to never return #48

tanglebones opened this issue Apr 1, 2015 · 2 comments

Comments

@tanglebones
Copy link

   [TestFixture]
   sealed public class NetJsonTf
   {
       sealed public class TestObj
       {
           public string str { get; set; }
       }

       [Test]
       public void Test()
       {
           var inp = "{str:\"any\"}";

           Func<TestObj, string> serialize = NetJSON.NetJSON.Serialize<TestObj>;
           Func<string, TestObj> deserialize = NetJSON.NetJSON.Deserialize<TestObj>;

           var status = new TestObj { str = "any" };
           var ser = serialize(status);

           var status1 = deserialize(inp); // infinite loop?

           Console.WriteLine(ser);
       }
   }
@tanglebones
Copy link
Author

Throwing an exception, returning an error, or ignoring invalid input would be fine... but never returning from the call is a bit of a blocker. I'm using 1.0.7 installed via NuGet.

@rpgmaker
Copy link
Owner

rpgmaker commented Apr 2, 2015

Sorry I will fix it. Thanks for the finding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants