Closed Bug 734090 Opened 12 years ago Closed 12 years ago

GB18030 decoder maps reserved 4-bytes ranges to random Unicode values

Categories

(Core :: Internationalization, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: emk, Assigned: emk)

Details

Attachments

(1 file, 2 obsolete files)

Attached patch Added a range check (obsolete) — Splinter Review
      No description provided.
Attachment #604069 - Flags: review?(smontagu)
Assignee: nobody → VYV03354
Attached patch Added a range check (obsolete) — Splinter Review
Forgot hg add
Attachment #604069 - Attachment is obsolete: true
Attachment #604072 - Flags: review?(smontagu)
Attachment #604069 - Flags: review?(smontagu)
Comment on attachment 604072 [details] [diff] [review]
Added a range check

Review of attachment 604072 [details] [diff] [review]:
-----------------------------------------------------------------

::: intl/uconv/ucvcn/nsGBKToUnicode.cpp
@@ +298,5 @@
>    a3 -= (PRUint8)0x81;
>    a4 -= (PRUint8)0x30;
>    PRUint32 idx = (((a1 * 10 + a2 ) * 126 + a3) * 10) + a4;
> +  if (idx > 0x000FFFFF)
> +    return false;

I thought this was a mistake until I realized that idx == ucs4Codepoint - 0x10000. Can you add a comment saying that? r=me with that.
Attachment #604072 - Flags: review?(smontagu) → review+
Attachment #604072 - Attachment is obsolete: true
Attachment #604207 - Flags: review+
Whiteboard: [autoland-try]
Whiteboard: [autoland-try] → [autoland-in-queue]
Autoland Patchset:
	Patches: 604207
	Branch: mozilla-central => try
Patch 604207 could not be applied to mozilla-central.
file intl/uconv/tests/unit/test_decode_gb18030.js already exists
1 out of 1 hunks FAILED -- saving rejects to file intl/uconv/tests/unit/test_decode_gb18030.js.rej
abort: patch failed to apply

Patchset could not be applied and pushed.
Whiteboard: [autoland-in-queue]
Pushed to try server manually.
https://tbpl.mozilla.org/?tree=Try&rev=7fb859257698
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/c7981774c170
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: