Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: net/cert/cert_verify_proc_builtin.cc

Issue 2760723002: Check X509Certificate::CreateFromHandle result. (Closed)
Patch Set: 2nd round of updates Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/cert/cert_verify_proc_builtin.cc
diff --git a/net/cert/cert_verify_proc_builtin.cc b/net/cert/cert_verify_proc_builtin.cc
index 0ac039942e1c9c61f002da8e01a00a75ed3d7fc1..67e91e5f656753fbeff6d92009f3e36930a4a7b6 100644
--- a/net/cert/cert_verify_proc_builtin.cc
+++ b/net/cert/cert_verify_proc_builtin.cc
@@ -309,6 +309,8 @@ scoped_refptr<X509Certificate> CreateVerifiedCertChain(
scoped_refptr<X509Certificate> result = X509Certificate::CreateFromHandle(
target_cert->os_cert_handle(), intermediates);
+ // |target_cert| was already successfully parsed, so this should never fail.
+ DCHECK(result);
for (const X509Certificate::OSCertHandle handle : intermediates)
X509Certificate::FreeOSCertHandle(handle);

Powered by Google App Engine
This is Rietveld 408576698