diff options
author | wtc%netscape.com <devnull@localhost> | 2003-07-10 01:45:02 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2003-07-10 01:45:02 +0000 |
commit | 43595dd9696d705255b6cfbc7078efb1269aea0d (patch) | |
tree | 4222bea621c3f1cadbe0a812cd6a0f0153b72f23 | |
parent | 0d7be79b51a0704216db61b027bb2caec1aae432 (diff) | |
download | nss-hg-43595dd9696d705255b6cfbc7078efb1269aea0d.tar.gz |
Change cert_GetCertificateEmailAddresses to return NULL rather than
a pointer to an empty string when a cert has no email addresses.
Partial fix for bug 211540. Modified certdb/alg1485.c
Tag: NSS_3_8_BRANCH
-rw-r--r-- | security/nss/lib/certdb/alg1485.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/security/nss/lib/certdb/alg1485.c b/security/nss/lib/certdb/alg1485.c index e414f4eb4..b84915f11 100644 --- a/security/nss/lib/certdb/alg1485.c +++ b/security/nss/lib/certdb/alg1485.c @@ -1130,11 +1130,13 @@ cert_GetCertificateEmailAddresses(CERTCertificate *cert) } /* now copy superstring to cert's arena */ finalLen = (pBuf - addrBuf) + 1; - pBuf = PORT_ArenaAlloc(cert->arena, finalLen); - if (pBuf) { - PORT_Memcpy(pBuf, addrBuf, finalLen); + pBuf = NULL; + if (finalLen > 1) { + pBuf = PORT_ArenaAlloc(cert->arena, finalLen); + if (pBuf) { + PORT_Memcpy(pBuf, addrBuf, finalLen); + } } - loser: if (tmpArena) PORT_FreeArena(tmpArena, PR_FALSE); |