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


git-svn-id: svn://10.0.0.236/trunk@144625 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nelsonb%netscape.com
2003-07-09 04:14:23 +00:00
parent b92ea1b87f
commit 1c7ab81449

View File

@@ -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);