#172700 NS_ConvertUTF8ToUCS2() surrogates buffer overflow

allocate enough space for surrogate.
p=jgmyers, r=shanjian, sr=dbaron, a=blizzard


git-svn-id: svn://10.0.0.236/trunk@132607 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
shanjian%netscape.com 2002-10-28 22:56:03 +00:00
parent 64865ebee6
commit 6ca97a5e22
2 changed files with 6 additions and 2 deletions

View File

@ -1389,8 +1389,10 @@ class CalculateUTF8Length
p += 2;
else if ( UTF8traits::is3byte(*p) )
p += 3;
else if ( UTF8traits::is4byte(*p) )
else if ( UTF8traits::is4byte(*p) ) {
p += 4;
++mLength;
}
else if ( UTF8traits::is5byte(*p) )
p += 5;
else if ( UTF8traits::is6byte(*p) )

View File

@ -1389,8 +1389,10 @@ class CalculateUTF8Length
p += 2;
else if ( UTF8traits::is3byte(*p) )
p += 3;
else if ( UTF8traits::is4byte(*p) )
else if ( UTF8traits::is4byte(*p) ) {
p += 4;
++mLength;
}
else if ( UTF8traits::is5byte(*p) )
p += 5;
else if ( UTF8traits::is6byte(*p) )