From 96cda705dcbeb79429055c1acca91f149d318820 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 15 Dec 2011 17:31:52 +0000 Subject: [PATCH] Fix for assertion failure Change-Id: I97b9ecc37e938a3050793fc746288243a1cb40b7 Reviewed-by: Peter Hartmann --- src/network/access/qnetworkaccessauthenticationmanager.cpp | 5 +++++ src/network/access/qnetworkaccessauthenticationmanager_p.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/network/access/qnetworkaccessauthenticationmanager.cpp b/src/network/access/qnetworkaccessauthenticationmanager.cpp index b618ccc945..9551b767df 100644 --- a/src/network/access/qnetworkaccessauthenticationmanager.cpp +++ b/src/network/access/qnetworkaccessauthenticationmanager.cpp @@ -159,6 +159,11 @@ void QNetworkAccessAuthenticationManager::cacheProxyCredentials(const QNetworkPr QString realm = authenticator->realm(); QNetworkProxy proxy = p; proxy.setUser(authenticator->user()); + + // don't cache null passwords, empty password may be valid though + if (authenticator->password().isNull()) + return; + // Set two credentials: one with the username and one without do { // Set two credentials actually: one with and one without the realm diff --git a/src/network/access/qnetworkaccessauthenticationmanager_p.h b/src/network/access/qnetworkaccessauthenticationmanager_p.h index ddfc11606d..718c58fc8d 100644 --- a/src/network/access/qnetworkaccessauthenticationmanager_p.h +++ b/src/network/access/qnetworkaccessauthenticationmanager_p.h @@ -73,7 +73,7 @@ public: QString user; QString password; bool isNull() { - return domain.isNull(); + return domain.isNull() && user.isNull() && password.isNull(); } }; Q_DECLARE_TYPEINFO(QNetworkAuthenticationCredential, Q_MOVABLE_TYPE);