| Issue 78: | Infinite Loop when parsing invalid JSON string: {" | |
| 2 people starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem?
1. Attempt to parse the following string:
{"
What is the expected output? What do you see instead?
I was expecting an error of sorts, or for the parser to bail out.
What version of the product are you using? On what operating system?
This was in version 1.0.7 and appears to be present.
Please provide any additional information below.
The fix can be made in CJSONScanner.m on line 400. The while loop will constantly look for a closing quote symbol, but not realize that it's at the end of the JSON string. My naive fix is to simply add the condition: "&& current != end" to the loop condition. (I'd provide a patch but this change is extremely trivial... and most likely doesn't take into consideration all possible cases).
Aug 11, 2010
Project Member
#1
jwight
Status:
Fixed
|