зеркало из https://github.com/mozilla/pjs.git
Fix for bug 216474 - Browser crashes in password manager. Ensure that we don't crash or overwrite variables used to hold valid password data fields with null. r=bryner
This commit is contained in:
Родитель
e2b1915ce5
Коммит
1482a2bd46
|
@ -621,21 +621,26 @@ nsPasswordManager::OnStateChange(nsIWebProgress* aWebProgress,
|
|||
|
||||
nsCOMPtr<nsIForm> form = do_QueryInterface(formNode);
|
||||
SignonDataEntry* firstMatch = nsnull;
|
||||
nsCOMPtr<nsIDOMHTMLInputElement> userField, passField;
|
||||
nsCOMPtr<nsIDOMHTMLInputElement> userField, passField;
|
||||
nsCOMPtr<nsIDOMHTMLInputElement> temp;
|
||||
|
||||
for (SignonDataEntry* e = hashEnt->head; e; e = e->next) {
|
||||
|
||||
nsCOMPtr<nsISupports> foundNode;
|
||||
form->ResolveName(e->userField, getter_AddRefs(foundNode));
|
||||
userField = do_QueryInterface(foundNode);
|
||||
|
||||
if (!userField)
|
||||
form->ResolveName(e->userField, getter_AddRefs(foundNode));
|
||||
temp = do_QueryInterface(foundNode);
|
||||
|
||||
if (temp)
|
||||
userField = temp;
|
||||
else
|
||||
continue;
|
||||
|
||||
form->ResolveName(e->passField, getter_AddRefs(foundNode));
|
||||
passField = do_QueryInterface(foundNode);
|
||||
|
||||
if (!passField)
|
||||
form->ResolveName(e->passField, getter_AddRefs(foundNode));
|
||||
temp = do_QueryInterface(foundNode);
|
||||
|
||||
if (temp)
|
||||
passField = temp;
|
||||
else
|
||||
continue;
|
||||
|
||||
if (firstMatch) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче