bug 703100 followup - fix potential crash due to string not being null-terminated.

This commit is contained in:
Jonathan Kew 2012-01-05 14:41:37 +00:00
Родитель c9b5aa3a72
Коммит cb01e05f33
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -1849,7 +1849,8 @@ gfxFont::GetShapedWord(gfxContext *aContext,
ok = ShapeWord(aContext, sw, (const PRUnichar*)aText);
} else {
nsAutoString utf16;
AppendASCIItoUTF16((const char*)aText, utf16);
AppendASCIItoUTF16(nsDependentCSubstring((const char*)aText, aLength),
utf16);
ok = ShapeWord(aContext, sw, utf16.BeginReading());
}
NS_WARN_IF_FALSE(ok, "failed to shape word - expect garbled text");