Skip to content

Commit

Permalink
Change cert_GetCertificateEmailAddresses to return NULL rather than
Browse files Browse the repository at this point in the history
a pointer to an empty string when a cert has no email addresses.
Partial fix for bug 211540.  Modified certdb/alg1485.c
  • Loading branch information
nelsonb%netscape.com committed Jul 9, 2003
1 parent d81d3d3 commit e5eb091
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions security/nss/lib/certdb/alg1485.c
Expand Up @@ -1029,11 +1029,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);
Expand Down

0 comments on commit e5eb091

Please sign in to comment.