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 {