Closed Bug 494099 Opened 15 years ago Closed 15 years ago

invalid read test_bug381412.hk.gb2312.js

Categories

(Core :: Internationalization, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: sayrer, Assigned: smontagu)

References

Details

Attachments

(2 files, 1 obsolete file)

see attached
Attached file valgrind log
Assignee: nobody → smontagu
Component: General → Internationalization
QA Contact: general → i18n
Bug 90411 is closely related to this.
Attached patch Patch (obsolete) — Splinter Review
So bug 90411 and this are two sides of the same coin: the decoder doesn't take into account that a multi-byte sequence can be split across buffer boundaries, so on the one hand it tries to read to the end of the sequence beyond the end of the input, and on the other hand it fails to decode the end of the sequence correctly at the beginning of the next buffer.
Attachment #381280 - Flags: review?
Attachment #381280 - Flags: review? → review?(VYV03354)
Comment on attachment 381280 [details] [diff] [review]
Patch

> +    if (!oddByte) {
> +      if (srcByte & 0x80 || srcByte == HZLEAD1 || mHZState == HZ_STATE_GB) { 
> +        oddByte = srcByte;
NUL bytes will be ignored in GB mode. Is it intentional?
Attached patch patch v.2Splinter Review
Yes, good catch, it wasn't intentional :)
Attachment #381280 - Attachment is obsolete: true
Attachment #383152 - Flags: review?(VYV03354)
Attachment #381280 - Flags: review?(VYV03354)
Attachment #383152 - Flags: review?(VYV03354) → review+
http://hg.mozilla.org/mozilla-central/rev/92a9095b9b0b
Status: NEW → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Blocks: 90411
Group: core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: