diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-08 12:30:01 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-08 12:30:01 +0000 |
commit | c8332f2737d0a0f9f3de94b0100e5a890b78dc4b (patch) | |
tree | 27f368341f1f8d421bb735935c66db6e89f221f9 | |
parent | 3b9b61fee4b14537984d24abf0a13812229f28ca (diff) | |
download | chromium_src-c8332f2737d0a0f9f3de94b0100e5a890b78dc4b.zip chromium_src-c8332f2737d0a0f9f3de94b0100e5a890b78dc4b.tar.gz chromium_src-c8332f2737d0a0f9f3de94b0100e5a890b78dc4b.tar.bz2 |
Handle a NULL trust anchor cert (cert_po_trustAnchor) returned by
CERT_PKIXVerifyCert.
R=rsleevi@chromium.org
BUG=115978
TEST=none
Review URL: http://codereview.chromium.org/9476029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125595 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/base/x509_certificate_nss.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/base/x509_certificate_nss.cc b/net/base/x509_certificate_nss.cc index e7677ae..5340087 100644 --- a/net/base/x509_certificate_nss.cc +++ b/net/base/x509_certificate_nss.cc @@ -248,7 +248,7 @@ void GetCertChainInfo(CERTCertList* cert_list, // IsKnownRoot returns true if the given certificate is one that we believe // is a standard (as opposed to user-installed) root. bool IsKnownRoot(CERTCertificate* root) { - if (!root->slot) + if (!root || !root->slot) return false; // This magic name is taken from @@ -700,7 +700,8 @@ void AppendPublicKeyHashes(CERTCertList* cert_list, node = CERT_LIST_NEXT(node)) { hashes->push_back(CertPublicKeyHash(node->cert)); } - hashes->push_back(CertPublicKeyHash(root_cert)); + if (root_cert) + hashes->push_back(CertPublicKeyHash(root_cert)); } } // namespace |