epiphany r8375 - branches/gnome-2-24/embed/mozilla



Author: chpe
Date: Mon Aug  4 12:48:42 2008
New Revision: 8375
URL: http://svn.gnome.org/viewvc/epiphany?rev=8375&view=rev

Log:
Bail out if listing the passwords fails or there are no results. Possibly fixes bug #542383.

Modified:
   branches/gnome-2-24/embed/mozilla/mozilla-embed-single.cpp

Modified: branches/gnome-2-24/embed/mozilla/mozilla-embed-single.cpp
==============================================================================
--- branches/gnome-2-24/embed/mozilla/mozilla-embed-single.cpp	(original)
+++ branches/gnome-2-24/embed/mozilla/mozilla-embed-single.cpp	Mon Aug  4 12:48:42 2008
@@ -925,14 +925,18 @@
 
 #ifdef HAVE_GECKO_1_9
 	nsILoginInfo **logins = nsnull;
-	PRUint32 count,i;
+	PRUint32 count = 0,i;
 	nsresult rv;
 
 	nsCOMPtr<nsILoginManager> loginManager =
 			do_GetService (NS_LOGINMANAGER_CONTRACTID);
 	NS_ENSURE_TRUE (loginManager, NULL);
 
-	loginManager -> GetAllLogins(&count, &logins);
+	rv = loginManager -> GetAllLogins(&count, &logins);
+	if (NS_FAILED (rv))
+		return NULL;
+	if (count <= 0 || !logins)
+		return NULL;
 
 	for (i=0; i < count; i++) {
 		nsString transfer;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]