Closed Bug 173180 Opened 19 years ago Closed 19 years ago
Rhino UTF-8 decoder accepts overlong sequences
This is the Rhino version of bug 172699 against SpiderMonkey. EXAMPLE: decodeURI("%C0%AF").charCodeAt(0) should result in 65533 The testcase for this is mozilla/js/tests/js1_5/Regress/regress-172699.js which is currently failing in Rhino: *-* Testcase js1_5/Regress/regress-172699.js failed: Bug Number 172699 STATUS: UTF-8 decoder should not accept overlong sequences Failure messages were: FAILED!: Section 1 of test - FAILED!: Expected value '65533', Actual value '37'
The patch merges utf8ToOneUcs4Char body into the decode method and adds checks for overlongs to follow SpiderMonkey.
I commited the above patch, so now Rhino passes the tests.
Marking FIXED. The above testcase now passes for me in the Rhino shells on WinNT, in both compiled and interpreted mode -
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Marking Verified -
Status: RESOLVED → VERIFIED
Targeting as resolved against 1.5R4
Target Milestone: --- → 1.5R4
You need to log in before you can comment on or make changes to this bug.