Bug 419654 - "Importing bookmark file corrupts heap (reproducible)" (Fix heap corruption and increase initial capacity) [p=ondrej@allpeers.com (Ondrej Brablc) r=dietrich a=blocking-firefox3+]

This commit is contained in:
reed%reedloden.com 2008-03-05 10:31:55 +00:00
Родитель 4b300e60ec
Коммит 3e081689e5
1 изменённых файлов: 9 добавлений и 1 удалений

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

@ -329,6 +329,8 @@ nsPlacesImportExportService::~nsPlacesImportExportService()
class BookmarkContentSink : public nsIHTMLContentSink
{
public:
BookmarkContentSink();
nsresult Init(PRBool aAllowRootChanges,
nsINavBookmarksService* bookmarkService,
PRInt64 aFolder,
@ -436,6 +438,10 @@ protected:
#endif
};
BookmarkContentSink::BookmarkContentSink() : mFrames(16)
{
}
// BookmarkContentSink::Init
//
// Note that the bookmark service pointer is passed in. We can not create
@ -1222,9 +1228,11 @@ BookmarkContentSink::NewFrame()
// don't clear last-modified, in case there's a description
}
frame.mPreviousId = ourID;
if (!mFrames.AppendElement(BookmarkImportFrame(ourID)))
return NS_ERROR_OUT_OF_MEMORY;
frame.mPreviousId = ourID;
return NS_OK;
}