Index: net/base/x509_certificate_win.cc |
=================================================================== |
--- net/base/x509_certificate_win.cc (revision 107404) |
+++ net/base/x509_certificate_win.cc (working copy) |
@@ -522,18 +522,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_); |