The problem was that the parser would read beyond a backslash even if it
was the last character, so rather than reporting it as invalid JSON and
throwing an error it would try to read beyond the string and crash. This
fix just adds a check to ensure that the parser doesn't read out of
bounds.
Also added a test to handle this case.
I'm still not very familiar with the code base, so if there are any styles nits, or any other feedback I'd be grateful!
The problem was that the parser would read beyond a backslash even if it was the last character, so rather than reporting it as invalid JSON and throwing an error it would try to read beyond the string and crash. This fix just adds a check to ensure that the parser doesn't read out of bounds.
Also added a test to handle this case.
I'm still not very familiar with the code base, so if there are any styles nits, or any other feedback I'd be grateful!