Crash when parsing a big json file
Issue #25
resolved
If I try to parse this json file the toolkit crashes. This is the same test as j0185 except it has newlines and spaces removed.
It crashes because bigkey->count isn't incremented when bigkey is expanded and this mismatch compounds over time and things start to crash. The normal version isn't crashing because the count is incremented on empty chars, so the bigkey will grow (unnecessarily) and we have enough room to put all the real values.
By discarding the empty chars (code) the normal version will also crash.
To fix this crash we can apply this fix.
Other way and maybe better, so we don't need the empty char stuff, might be this fix.
Comments (2)
-
Account Deleted -
reporter - changed status to resolved
Thank you, this implementation seems fine. No more crashes.
- Log in to comment
Ok, fix for json_grow_key. Thanks.
Note: I used your idea for count (k). However, I wanted to keep the key count and max internals 'encapsulated' in json_grow_key (C++ish). Thanks.