mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 02:57:38 +00:00
fix crash in AddNewNamespace. We were iterating through a list of name spaces backwards incorrectly. We were starting with one past the last element in the array and then attempting to dereference it....
This commit is contained in:
parent
485ceb9e8c
commit
eb551ad681
@ -104,13 +104,13 @@ int nsIMAPNamespaceList::AddNewNamespace(nsIMAPNamespace *ns)
|
||||
if (!ns->GetIsNamespaceFromPrefs())
|
||||
{
|
||||
int nodeIndex = 0;
|
||||
for (nodeIndex=m_NamespaceList.Count(); nodeIndex > 0; nodeIndex--)
|
||||
for (nodeIndex=m_NamespaceList.Count()-1; nodeIndex >= 0; nodeIndex--)
|
||||
{
|
||||
nsIMAPNamespace *nspace = (nsIMAPNamespace *) m_NamespaceList.ElementAt(nodeIndex);
|
||||
if (nspace->GetIsNamespaceFromPrefs())
|
||||
if (nspace && nspace->GetIsNamespaceFromPrefs())
|
||||
{
|
||||
m_NamespaceList.RemoveElement(nspace);
|
||||
delete nspace;
|
||||
delete nspace;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user