mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 507379 - hostname from SSL_RevealURL is null checked too late [@ nsDependentCString - nsNSSBadCertHandler]; r=kaie
This commit is contained in:
parent
1766cc0dda
commit
672d60d0bf
@ -3197,8 +3197,11 @@ nsNSSBadCertHandler(void *arg, PRFileDesc *sslSocket)
|
||||
PRErrorCode errorCodeTrust = SECSuccess;
|
||||
PRErrorCode errorCodeMismatch = SECSuccess;
|
||||
PRErrorCode errorCodeExpired = SECSuccess;
|
||||
|
||||
|
||||
char *hostname = SSL_RevealURL(sslSocket);
|
||||
if (!hostname)
|
||||
return cancel_and_failure(infoObject);
|
||||
|
||||
charCleaner hostnameCleaner(hostname);
|
||||
nsDependentCString hostString(hostname);
|
||||
|
||||
@ -3212,7 +3215,7 @@ nsNSSBadCertHandler(void *arg, PRFileDesc *sslSocket)
|
||||
NS_ConvertUTF8toUTF16 hostWithPortStringUTF16(hostWithPortString);
|
||||
|
||||
// Check the name field against the desired hostname.
|
||||
if (hostname && hostname[0] &&
|
||||
if (hostname[0] &&
|
||||
CERT_VerifyCertName(peerCert, hostname) != SECSuccess) {
|
||||
collected_errors |= nsICertOverrideService::ERROR_MISMATCH;
|
||||
errorCodeMismatch = SSL_ERROR_BAD_CERT_DOMAIN;
|
||||
|
Loading…
Reference in New Issue
Block a user