Originally filed by danjwilson on 2009-08-23T12:51:56
What steps will reproduce the problem?
What is the expected output? What do you see instead?
Unescaped string. Instead you get a JSON parse error: "Unexpected end of input. Expecting 4
hex digits after \u."
What version of the product are you using? On what operating system?
Bug introduced in revision 95
Please provide any additional information below.
The bug is in the check on line 340:
if ( nextSubstringStartPosition + 4 >= len )
which should be:
if ( nextSubstringStartPosition + 4 > len )
"\u1234" has len=6, nextSubstringStartPosition is the character after the "\u", in position 2,
therefore (nextSubstringStartPosition + 4 >= len) evaluates to true and therefore throws a parse
Updated by darron.schall on 2009-08-24T13:20:40
Fixed in r97, thanks. I actually had a test for this, but the test was incorrect (didn't escape the "" before the u,
which meant it the escape sequence wasn't actually an escape sequence by the time it was decoded... doh!).
Fixing the test highlighted the problem, and your patch worked great to make the test pass.
Original ticket set status to Fixed (we converted to closed)