Closed Bug 906698 Opened 7 years ago Closed 7 years ago
On big-endian processor, ns
UTF16To Unicode Base::UTF16Convert To Unicode is mis-converting UTF16 data
User Agent: Mozilla/5.0 (Macintosh; PPC Mac OS X 10.5; rv:17.0) Gecko/20130805 Firefox/17.0 TenFourFox/G5 (Nightly/Aurora) Build ID: 20130805171245 Steps to reproduce: On TenFourFox 22 with --enable-tests build config. Run xpcshell-tests Actual results: dom/encoding/test/unit/test_singlebytes.js unit test failied. Expected results: test passed without failure.
Before bitwise-or, (*src++) is implicitly cast to int16_t. If src has negative value, upper byte of casted src is 0xff. It mask upper byte of u. this patch prevent it.
Thanks for the patch! You should ask someone to review it though, otherwise it's likely to get ignored. I suggest that you request a review from :smontagu, as he's previously worked on this code. The patch review and submission process is explained in more detail here: https://developer.mozilla.org/en-US/docs/Developer_Guide/How_to_Submit_a_Patch
Comment on attachment 792229 [details] [diff] [review] patch for intl/uconv/ucvlatin/nsUTF16ToUnicode.cpp Thank you for your information. I request review to :smontagu.
Attachment #792229 - Flags: review?(smontagu)
Comment on attachment 792229 [details] [diff] [review] patch for intl/uconv/ucvlatin/nsUTF16ToUnicode.cpp Review of attachment 792229 [details] [diff] [review]: ----------------------------------------------------------------- Good catch, thanks!
Attachment #792229 - Flags: review?(smontagu) → review+
Assignee: nobody → t_mrc-ct
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
See https://developer.mozilla.org/en-US/docs/Creating_a_patch_that_can_be_checked_in for how to upload a new patch file and add the checkin-needed keyword to get this checked in.
fix patch format.
Comment on attachment 793478 [details] [diff] [review] Bug 906698 - nsUTF16ToUnicode is mis-converting on big-endian processor You don't need to re-request review when all that's changing is the patch format.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.