#29 parsing error

closed-works-for-me
nobody
Reader (16)
9
2011-07-06
2011-05-16
Anonymous
No

jsoncpp wrongly considers an invalid JSON input such as

"1111 {}" as valid JSON.

Discussion

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2011-05-16
    • priority: 5 --> 9
     
  • Christopher Dunn

    Use strict-mode.

    Json::Value root;
    Json::Features f = Json::Features::strictMode();
    Json::Reader reader(f);
    // ...

    * Line 1, Column 1
    A valid JSON document must be either an array or an object value.

    However, even then trailing data will be ignored. I *think* it will remain on the stream, but submit another bug if not.

    E.g., "{} {}" parses as a single, empty JSON object.

     
  • Christopher Dunn

    • status: open --> open-works-for-me
     
  • Christopher Dunn

    • status: open-works-for-me --> pending-works-for-me
     
  • SourceForge Robot

    • status: pending-works-for-me --> closed-works-for-me
     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks