aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2008-08-04 20:48:42 +0800
committerChristian Persch <chpe@src.gnome.org>2008-08-04 20:48:42 +0800
commit4e61e7ef040b608b108487f3de858253510af178 (patch)
treed38325aa32a6e3547cfa33de232e4e8b0e550a27 /embed
parentc1330f467454504b7205c8eaf24414e5b8ec4eca (diff)
downloadgsoc2013-epiphany-4e61e7ef040b608b108487f3de858253510af178.tar
gsoc2013-epiphany-4e61e7ef040b608b108487f3de858253510af178.tar.gz
gsoc2013-epiphany-4e61e7ef040b608b108487f3de858253510af178.tar.bz2
gsoc2013-epiphany-4e61e7ef040b608b108487f3de858253510af178.tar.lz
gsoc2013-epiphany-4e61e7ef040b608b108487f3de858253510af178.tar.xz
gsoc2013-epiphany-4e61e7ef040b608b108487f3de858253510af178.tar.zst
gsoc2013-epiphany-4e61e7ef040b608b108487f3de858253510af178.zip
Bail out if listing the passwords fails or there are no results. Possibly fixes bug #542383.
svn path=/branches/gnome-2-24/; revision=8375
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/mozilla-embed-single.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp
index 63ac7fb12..ec49a7d5d 100644
--- a/embed/mozilla/mozilla-embed-single.cpp
+++ b/embed/mozilla/mozilla-embed-single.cpp
@@ -925,14 +925,18 @@ impl_list_passwords (EphyPasswordManager *manager)
#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;