Bug 11484. Be defensive if a null pointer is passed as the doc title in SetPageTitle().

This commit is contained in:
waterson%netscape.com 1999-08-12 08:46:35 +00:00
parent 508e0405a4
commit 8888847e25

View File

@ -724,6 +724,15 @@ nsGlobalHistory::AddPage(const char *aURL, const char *aReferrerURL, PRInt64 aDa
NS_IMETHODIMP
nsGlobalHistory::SetPageTitle(const char *aURL, const PRUnichar *aTitle)
{
NS_PRECONDITION(aURL != nsnull, "null ptr");
if (! aURL)
return NS_ERROR_NULL_POINTER;
// Be defensive if somebody sends us a null title.
static PRUnichar kEmptyString[] = { 0 };
if (! aTitle)
aTitle = kEmptyString;
mdb_err err;
PRInt32 len = PL_strlen(aURL);