Closed Bug 906698 Opened 7 years ago Closed 7 years ago

On big-endian processor, nsUTF16ToUnicodeBase::UTF16ConvertToUnicode is mis-converting UTF16 data

Categories

(Core :: Internationalization, defect)

PowerPC
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: t_mrc-ct, Assigned: t_mrc-ct)

Details

Attachments

(2 files, 1 obsolete file)

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.
Attachment #792229 - Attachment is obsolete: true
Attachment #793478 - Flags: review?(smontagu)
Keywords: checkin-needed
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.
Attachment #793478 - Flags: review?(smontagu)
https://hg.mozilla.org/mozilla-central/rev/2654e3d27d41
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.