My favorites | Sign in
Project Home
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 78: Infinite Loop when parsing invalid JSON string: {"
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Aug 2010


 
Reported by jos...@gmail.com, Jun 8, 2010
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
Fixed by https://code.google.com/p/touchcode/source/detail?r=4dac29f9b8
Status: Fixed

Powered by Google Project Hosting