Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

SF #620 Endless loop in JSON parser #241

Closed
aleks-f opened this Issue · 0 comments

1 participant

@aleks-f
Owner

From http://sourceforge.net/p/poco/bugs/620/

The JSON parser crashes if the string to be parsed contains a JSON string that is longer than the buffer. Specifically we run into this problem while parsing a string that is more than 6 KB long, while the default buffer size is 4 KB. But you can reproduce it with a much smaller buffer size:

    Poco::JSON::Parser parser(new Poco::JSON::ParseHandler(), 8);
    string jsonStr = "{ \"x\" : \"123456789012345678901234567890123456789012345678901234567890\" }";
    parser.parse(jsonStr);

Warning: Running this code will result in a very high memory usage and a very, very slow operating system.

@aleks-f aleks-f was assigned
@aleks-f aleks-f referenced this issue from a commit
@aleks-f aleks-f JSON bug fixes
GH #241: SF #620 Endless loop in JSON parser (added Buffer::setCapacity)
GH #242: SF #619 Syntax error in JSON parser (float/double trim)
20e1cf8
@aleks-f aleks-f closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.