EiffelWebFramework / EWF

Eiffel Web Framework -- Provide a common framework to build easily web server application in Eiffel (portable on various connector and platforms)
http://eiffelweb.projects.eiffel.org/
Other
44 stars 26 forks source link

JSON_PARSER.parse_string can exhaust memory #160

Open colin-adams opened 9 years ago

colin-adams commented 9 years ago

If an incomplete JSON document is being parsed (e.g. if you have only fetched 8K out of a 380K HTTP response), then parse_string will keep appending NULLs to the end of the string until memory is exhausted. This is because it keeps calling next without then testing if we have passed the end of the data, and actual returns %U.

It should check if we have passed the end of the data and set has_more to True (and is_parsed to False).

jocelyn commented 9 years ago

Hi Colin, Do you have a working patch that fixes this issue?

colin-adams commented 9 years ago

No. I bypassed it by correcting my HTTP fetch code, so i had a good document. :-)

On 29 January 2015 at 09:54, Jocelyn Fiat notifications@github.com wrote:

Hi Colin, Do you have a working patch that fixes this issue?

— Reply to this email directly or view it on GitHub https://github.com/EiffelWebFramework/EWF/issues/160#issuecomment-71997141 .