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

Unified Diff: net/base/x509_certificate_win.cc

Issue 8418034: Make string_util::WriteInto() DCHECK() that the supplied |length_with_null| > 1, meaning that the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
« no previous file with comments | « net/base/net_util.cc ('k') | net/disk_cache/entry_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/x509_certificate_win.cc
===================================================================
--- net/base/x509_certificate_win.cc (revision 111826)
+++ net/base/x509_certificate_win.cc (working copy)
@@ -557,18 +557,22 @@
&cert_handle_->pCertInfo->Subject,
CERT_X500_NAME_STR | CERT_NAME_STR_CRLF_FLAG,
NULL, 0);
+ if (name_size > 1) {
+ CertNameToStr(cert_handle_->dwCertEncodingType,
+ &cert_handle_->pCertInfo->Subject,
+ CERT_X500_NAME_STR | CERT_NAME_STR_CRLF_FLAG,
+ WriteInto(&subject_info, name_size), name_size);
+ }
name_size = CertNameToStr(cert_handle_->dwCertEncodingType,
- &cert_handle_->pCertInfo->Subject,
- CERT_X500_NAME_STR | CERT_NAME_STR_CRLF_FLAG,
- WriteInto(&subject_info, name_size), name_size);
- name_size = CertNameToStr(cert_handle_->dwCertEncodingType,
&cert_handle_->pCertInfo->Issuer,
CERT_X500_NAME_STR | CERT_NAME_STR_CRLF_FLAG,
NULL, 0);
- name_size = CertNameToStr(cert_handle_->dwCertEncodingType,
- &cert_handle_->pCertInfo->Issuer,
- CERT_X500_NAME_STR | CERT_NAME_STR_CRLF_FLAG,
- WriteInto(&issuer_info, name_size), name_size);
+ if (name_size > 1) {
+ CertNameToStr(cert_handle_->dwCertEncodingType,
+ &cert_handle_->pCertInfo->Issuer,
+ CERT_X500_NAME_STR | CERT_NAME_STR_CRLF_FLAG,
+ WriteInto(&issuer_info, name_size), name_size);
+ }
ParsePrincipal(WideToUTF8(subject_info), &subject_);
ParsePrincipal(WideToUTF8(issuer_info), &issuer_);
« no previous file with comments | « net/base/net_util.cc ('k') | net/disk_cache/entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698