Skip to content

SF #620 Endless loop in JSON parser #241

Closed
aleks-f opened this Issue Jul 22, 2013 · 0 comments

1 participant

@aleks-f
POCO C++ Libraries member
aleks-f commented Jul 22, 2013

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 Jul 22, 2013
@aleks-f aleks-f added a commit that referenced this issue Jul 22, 2013
@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 Jul 22, 2013
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.