mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 11484. Be defensive if a null pointer is passed as the doc title in SetPageTitle().
This commit is contained in:
parent
508e0405a4
commit
8888847e25
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user