#172700 NS_ConvertUTF8ToUCS2() surrogates buffer overflow

allocate enough space for surrogate.
p=jgmyers, r=shanjian, sr=dbaron, a=blizzard
This commit is contained in:
shanjian%netscape.com 2002-10-28 22:56:03 +00:00
parent f9d3e11926
commit 56103cc0a9
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) )