diff options
author | nelsonb%netscape.com <devnull@localhost> | 2003-11-15 00:10:01 +0000 |
---|---|---|
committer | nelsonb%netscape.com <devnull@localhost> | 2003-11-15 00:10:01 +0000 |
commit | 7bc73da2b2f7e8138f9b831fc7f65ffd7de5632a (patch) | |
tree | a43a3ccb52ff89fcfba2ce8f49739f13061ce782 /security/nss/lib/pki/pki3hack.c | |
parent | c49e8312b2a9e29dd5c556301720a702206c0b93 (diff) | |
download | nss-hg-7bc73da2b2f7e8138f9b831fc7f65ffd7de5632a.tar.gz |
Detect empty emailAddr strings in CERTCertificates. Bugzilla bug 211540.
Modified Files:
cmd/dbck/dbck.c cmd/signtool/util.c lib/certdb/certdb.c
lib/certdb/stanpcertdb.c lib/pkcs7/p7decode.c lib/pki/certificate.c
lib/pki/pki3hack.c lib/smime/cmssiginfo.c lib/softoken/pkcs11u.c
Diffstat (limited to 'security/nss/lib/pki/pki3hack.c')
-rw-r--r-- | security/nss/lib/pki/pki3hack.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/security/nss/lib/pki/pki3hack.c b/security/nss/lib/pki/pki3hack.c index 6998d84d6..eb8dd7f78 100644 --- a/security/nss/lib/pki/pki3hack.c +++ b/security/nss/lib/pki/pki3hack.c @@ -394,7 +394,8 @@ static NSSASCII7 * nss3certificate_getEmailAddress(nssDecodedCert *dc) { CERTCertificate *cc = (CERTCertificate *)dc->data; - return cc ? (NSSASCII7 *)cc->emailAddr : NULL; + return (cc && cc->emailAddr && cc->emailAddr[0]) + ? (NSSASCII7 *)cc->emailAddr : NULL; } static PRStatus @@ -865,7 +866,7 @@ STAN_GetNSSCertificate(CERTCertificate *cc) nssItem_Create(arena, &c->serial, derSerial.len, derSerial.data); PORT_Free(derSerial.data); } - if (cc->emailAddr) { + if (cc->emailAddr && cc->emailAddr[0]) { c->email = nssUTF8_Create(arena, nssStringType_PrintableString, (NSSUTF8 *)cc->emailAddr, |