Closed Bug 138578 Opened 22 years ago Closed 19 years ago

Japanese to Unicode decoder has problem for its internal state

Categories

(Core :: Internationalization, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla1.8beta2

People

(Reporter: nhottanscp, Assigned: jshin1987)

References

Details

(Keywords: intl, Whiteboard: [eta 8/30])

Attachments

(1 file)

This was discovered when debuging bug 120728.
The conversion fails when calling the ISO-2022-JP converter in the loop.
The first called returns NS_OK_UDEC_MOREOUTPUT which is expected if the output
buffer is not large enough. But the second call returns NS_ERROR_UNEXPECTED when
the input is actually valid.
Blocks: 120728
Keywords: intl
QA Contact: ruixu → teruko
In http://lxr.mozilla.org/seamonkey/source/intl/uconv/ucvja/nsJapaneseToUnicode.cpp
For all 3 converters, if we have goto error1; it mean there are no enough output
buffer. We already process the bytes, but we have not change the state . The
"mState =" should come before the goto statement. 

We think it is too risky to fix before m1.0 freeze. We need to fix this on trunk.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.1alpha
Target Milestone: mozilla1.1alpha → ---
if we want to change, we better change it before 1.2 alpha
Whiteboard: [eta 8/30]
Target Milestone: --- → mozilla1.2alpha
Assignee: ftang → jshin1987
Status: ASSIGNED → NEW
Blocks: 263797
I'll make sure that this will be fixed by 1.8beta2.
Severity: normal → major
Status: NEW → ASSIGNED
Target Milestone: mozilla1.2alpha → mozilla1.8beta2
Attached patch patchSplinter Review
This does what ftang wrote he would. 

It fixes bug 263797 and my 5 minute test at the following sites didn't reveal
any flaw (well, that's not a thorough test, but it shuold be fine)

http://www.jp.analog.cx/ml/archive/ (ISO-2022-JP)
http://www.mozilla.gr.jp (EUC-JP)
http://www.asahi.co.jp (EUC-JP)
http://www.yomiuri.co.jp (Shift_JIS)
http://www.u-tokyo.ac.jp (Shift_JIS)
Attachment #175282 - Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #175282 - Flags: review?(smontagu)
Comment on attachment 175282 [details] [diff] [review]
patch

Sorry, I don't understand this code.
Attachment #175282 - Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #175282 - Flags: superreview?(blizzard)
Comment on attachment 175282 [details] [diff] [review]
patch

I remember once writing a patch to refactor this decoder, but it may never have
got attached to a bug, so it was probably lost in the AOL layoffs. Anyway, the
fix seems correct.
Attachment #175282 - Flags: review?(smontagu) → review+
Attachment #175282 - Flags: superreview?(blizzard) → superreview+
thanks for r/sr. landed it.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: