зеркало из https://github.com/mozilla/gecko-dev.git
fix for bug #30646. crash on certain news messages. r=mscott, a=jar.
This commit is contained in:
Родитель
c70a2b380b
Коммит
394509ff28
|
@ -1138,6 +1138,10 @@ mozTXTToHTMLConv::ScanTXT(const PRUnichar *text, PRUint32 whattodo,
|
|||
// by setting a large capacity up front, we save time
|
||||
// when appending characters to the output string because we don't
|
||||
// need to reallocate and re-copy the characters already in the out String.
|
||||
NS_ASSERTION(inLength, "ScanTXT passed 0 length string");
|
||||
if (inLength == 0) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
outString.SetCapacity(inLength * growthRate);
|
||||
ScanTXT(text, inLength, whattodo, outString);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче