summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2003-07-10 01:50:30 +0000
committerwtc%netscape.com <devnull@localhost>2003-07-10 01:50:30 +0000
commit620a698cb0505b031852339db1843e0bf734ea83 (patch)
tree5b9f120e606de6e90af477ac21963e9a4d1db27e
parentd24c7182d012a0ceee85bbedc978abed6d837e19 (diff)
downloadnss-hg-620a698cb0505b031852339db1843e0bf734ea83.tar.gz
Change cert_GetCertificateEmailAddresses to return NULL rather thanNSS_3_7_8_BETA1
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_7_BRANCH
-rw-r--r--security/nss/lib/certdb/alg1485.c10
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);