From 37d139f34dc824c658949a7546205663372ba3a6 Mon Sep 17 00:00:00 2001 From: "kaie%kuix.de" Date: Mon, 2 Oct 2006 20:16:23 +0000 Subject: [PATCH] Bug 344817, PSM: fix UI display problems for X.509 certs with empty DNs Patch for GetWindowTitle, contributed by Kaspar Brand r=kengert --- security/manager/ssl/src/nsNSSCertificate.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/security/manager/ssl/src/nsNSSCertificate.cpp b/security/manager/ssl/src/nsNSSCertificate.cpp index 305f60646f5..2f886b6f7b8 100644 --- a/security/manager/ssl/src/nsNSSCertificate.cpp +++ b/security/manager/ssl/src/nsNSSCertificate.cpp @@ -391,7 +391,13 @@ nsNSSCertificate::GetWindowTitle(char * *aWindowTitle) } else { *aWindowTitle = CERT_GetCommonName(&mCert->subject); if (!*aWindowTitle) { - *aWindowTitle = PL_strdup(mCert->subjectName); + if (mCert->subjectName) { + *aWindowTitle = PL_strdup(mCert->subjectName); + } else if (mCert->emailAddr) { + *aWindowTitle = PL_strdup(mCert->emailAddr); + } else { + *aWindowTitle = PL_strdup(""); + } } } } else {