Closed Bug 160784 Opened 22 years ago Closed 7 years ago

nsIUnicodeDecoder::Convert can out a negative aSrcLength, but caller may not be able to back up

Categories

(Core :: Internationalization, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56

People

(Reporter: bzbarsky, Assigned: hsivonen)

References

Details

(Keywords: intl, Whiteboard: [fixed by encoding_rs])

The issue comes up when:

1)  The caller of Convert is using multiple byte buffers
2)  The data has an error that prevents proper decoding (an invalid byte sequence)
3)  The erroneous data spans a buffer boundary.

When the decoder determines that the byte sequence is invalid, it sets
aSrcLength negative to make the caller rewind to the start of the byte sequence.
 However, the caller may no longer have the beginning of the sequence, since it
was at the end of the previous buffer and the decoder said it consumed it. Thus
the caller is unable to rewind to the beginning of the erroneous sequence.

This problem affects nsConverterInputStream and the HTML scanner at the moment.
code issue, QA to yokoyama@netscape.com for now.
Keywords: intl
QA Contact: ruixu → yokoyama
Status: NEW → ASSIGNED
what a hack. I have not touch mozilla code for 2 years. I didn't read these bugs
for 2 years. And they are still there. Just close them as won't fix to clean up.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → WONTFIX
Mass Reassign Please excuse the spam
Assignee: ftang → nobody
Mass Re-opening Bugs Frank Tang Closed on Wensday March 02 for no reason, all
the spam is his fault feel free to tar and feather him
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Reassigning Franks old bugs to Jungshik Shin for triage - Sorry for spam
Assignee: nobody → jshin1987
Status: REOPENED → NEW
QA Contact: tetsuroy → i18n
Depends on: encoding_rs
Bug 1261841 introduced a new API that does not have this design defect.
Assignee: jshin1987 → hsivonen
Status: NEW → RESOLVED
Closed: 19 years ago7 years ago
Resolution: --- → FIXED
Whiteboard: [fixed by encoding_rs]
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.