Closed
Bug 5747
Opened 25 years ago
Closed 25 years ago
illegal bytes in the first byte of docuemnt cause hang in double byte charset
Categories
(Core Graveyard :: Tracking, defect, P2)
Tracking
(Not tracked)
VERIFIED
FIXED
M6
People
(Reporter: teruko, Assigned: ftang)
References
()
Details
Tested 4-29-08 Win32 build under Winnt4.0J and Window 95J.
Step of reproduce
1. Go to the above URL
2. Select menu View|Default Character Set->Korean(EUC_KR)
Apprunner hangs. It does not do anything.
Reporter | ||
Updated•25 years ago
|
Priority: P3 → P2
Target Milestone: M5
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•25 years ago
|
||
again, this is caused by illegal euc-kr. The first characters are 0xa0a0, which
is not legal euc-kr. Euc-kr start w/ 0xa1a1
Assignee | ||
Updated•25 years ago
|
Target Milestone: M5 → M6
Assignee | ||
Comment 2•25 years ago
|
||
this is cause by the ignorance of error handling in nsScanner::Append method. I
have the fix but I preferred we check in after M5. I think we can down grade
this to M6 because this will only hang when the first byte of the html have
error in converter, which I think is a rare case.
The fix is as below, need rickg to review and approve for M6 check in....
Z:\mozilla\htmlparser\src>cvs diff -c nsScanner.cpp
Index: nsScanner.cpp
===================================================================
RCS file: /m/pub/mozilla/htmlparser/src/nsScanner.cpp,v
retrieving revision 3.41
diff -c -r3.41 nsScanner.cpp
*** nsScanner.cpp 1999/04/21 04:02:14 3.41
--- nsScanner.cpp 1999/05/01 00:51:46
***************
*** 244,257 ****
PRBool nsScanner::Append(const char* aBuffer, PRUint32 aLen){
if(mUnicodeDecoder) {
! PRInt32 unicharLength = 0;
! PRInt32 srcLength = aLen;
! mUnicodeDecoder->Length(aBuffer, 0, aLen, &unicharLength);
! PRUnichar *unichars = new PRUnichar [ unicharLength ];
! nsresult res = mUnicodeDecoder->Convert(unichars, 0, &unicharLength,aBuffe
r, 0, &srcLength );
! mBuffer.Append(unichars, unicharLength);
! delete[] unichars;
! mTotalRead += unicharLength;
}
else {
--- 244,272 ----
PRBool nsScanner::Append(const char* aBuffer, PRUint32 aLen){
if(mUnicodeDecoder) {
! PRInt32 unicharBufLen = 0;
! mUnicodeDecoder->Length(aBuffer, 0, aLen, &unicharBufLen);
! PRUnichar *unichars = new PRUnichar [ unicharBufLen ];
! nsresult res;
! do {
! PRInt32 srcLength = aLen;
! PRInt32 unicharLength = unicharBufLen;
! res = mUnicodeDecoder->Convert(unichars, 0, &unicharLength,aBuff
er, 0, &srcLength );
! mBuffer.Append(unichars, unicharLength);
! mTotalRead += unicharLength;
! // if we failed, we consume one byte by replace it with U+FFFD
! // and try conversion again.
! if(NS_FAILED(res)) {
! mBuffer.Append( (PRUnichar)0xFFFD);
! mTotalRead++;
! aBuffer += srcLength + 1;
! aLen -= srcLength + 1;
! }
! } while (NS_FAILED(res) && (aLen > 0));
! // we continue convert the bytes data into Unicode
! // if we have conversion error and we have more data.
!
! delete[] unichars;
}
else {
Assignee | ||
Updated•25 years ago
|
Summary: Changing Character Set on no Meta Euc-KR page causes HANG → illegal bytes in the first byte of docuemnt cause hang in double byte charset
Target Milestone: M6 → M5
Assignee | ||
Comment 3•25 years ago
|
||
Change summary from "Changing Character Set on no Meta Euc-KR page causes HANG"
to "illegal bytes in the first byte of docuemnt cause hang in double byte
charset"
Updated•25 years ago
|
Target Milestone: M5 → M6
Comment 5•25 years ago
|
||
moving to m6.
Reporter | ||
Comment 6•25 years ago
|
||
Same thing happens as follows
1. Go to http://babel/tests/browser/bft/euc-jp/bft_browser_link.euc-jp.html
2. Select menu View|Default Character set->UTF-8
Apprunner hangs. Once I see Frank's fix, I will test this, too.
Assignee | ||
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 7•25 years ago
|
||
fix and check in.
Reporter | ||
Updated•25 years ago
|
Status: RESOLVED → VERIFIED
Reporter | ||
Comment 8•25 years ago
|
||
I verified this in 5-17-09 Win32 build.
Moving all Apprunner bugs past and present to Other component temporarily whilst
don and I set correct component. Apprunner component will be deleted/retired
shortly.
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•