Fix null pointer dereference in NTLM authentication
If NTLM authentication is required for the URL with an empty path, then QNetworkAuthenticationCache::findClosestMatch(url.path()) returns 0. e.g. "http://10.1.2.3". Return a default constructed credential in this case. Change-Id: I84ad3b308ee3f74fbbac9ad0f11dbdc66047b50b Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>bb10
parent
d6fb4463b8
commit
b830c9cede
|
|
@ -283,9 +283,12 @@ QNetworkAccessAuthenticationManager::fetchCachedCredentials(const QUrl &url,
|
|||
|
||||
QNetworkAuthenticationCache *auth =
|
||||
static_cast<QNetworkAuthenticationCache *>(authenticationCache.requestEntryNow(cacheKey));
|
||||
QNetworkAuthenticationCredential cred = *auth->findClosestMatch(url.path());
|
||||
QNetworkAuthenticationCredential *cred = auth->findClosestMatch(url.path());
|
||||
QNetworkAuthenticationCredential ret;
|
||||
if (cred)
|
||||
ret = *cred;
|
||||
authenticationCache.releaseEntry(cacheKey);
|
||||
return cred;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void QNetworkAccessAuthenticationManager::clearCache()
|
||||
|
|
|
|||
Loading…
Reference in New Issue