зеркало из https://github.com/mozilla/pjs.git
fix crash sorting large folders by subject, r=neil@parkwaycc, sr=mscott 230251
This commit is contained in:
Родитель
60d24d7b7a
Коммит
9c4d5c975d
|
@ -3464,9 +3464,12 @@ NS_IMETHODIMP nsMsgDBView::Sort(nsMsgViewSortTypeValue sortType, nsMsgViewSortOr
|
|||
// pTemp - pBase = the space we have used so far
|
||||
// sizeof(EntryInfo) + fieldLen = space we need for this entry
|
||||
// allocSize = size of the current block
|
||||
if ((PRUint32)(pTemp - pBase) + (keyOffset + actualFieldLen) >= allocSize) {
|
||||
if ((PRUint32)(pTemp - pBase) + (keyOffset + actualFieldLen) >= allocSize)
|
||||
{
|
||||
maxSize = (keyOffset + maxLen) * (arraySize - numSoFar);
|
||||
allocSize = PR_MIN(maxBlockSize, maxSize);
|
||||
// make sure allocSize is big enough for the current value
|
||||
allocSize = PR_MAX(allocSize, keyOffset + actualFieldLen);
|
||||
pTemp = (char *) PR_Malloc(allocSize);
|
||||
NS_ASSERTION(pTemp, "out of memory, can't sort");
|
||||
if (!pTemp)
|
||||
|
|
Загрузка…
Ссылка в новой задаче