News for hackers. Stuff that matters.
Re:Parsing JSON is a Minefield by benibela on Tuesday November 08, 2016 @08:35AM (#12900056)
It can always crash when there is not enough memory.

Especially on the stack.

On of the test cases has 100000 [ and my own JSON parser crashed on them, because it parsed recursively and the stack overflowed. So now I have fixed it to parse iteratively.

It still crashes.

Big surprise. Turns out the array destructor is also recursive, because it deletes every element in the array. So the array destructor crashes at some random point, after the parser has worked correctly.

There are no comments on this comment yet.