The code can enter an infinite loop after parsing a complex string that requires recursion.
Cause:
After recursively parsing of a child object, the string pointer is not incremented correctly. It is increased by the current _offset, rather than only the size of the child/recursed object(s).
Problem:
The code can enter an infinite loop after parsing a complex string that requires recursion.
Cause:
After recursively parsing of a child object, the string pointer is not incremented correctly. It is increased by the current _offset, rather than only the size of the child/recursed object(s).
e.g.
After parsing {"first":"John", "last":"Doe"}, the string pointer is incorrectly advanced to the "2", instead of the ",".
Solution:
Increment the string pointer by the size of the recursed child objects, rather than the current (already incremented) _offset.