summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2002-11-27 01:28:03 +0000
committerwtc%netscape.com <devnull@localhost>2002-11-27 01:28:03 +0000
commitd52ffc22348f9c888f9c4a64ec74c7d786894956 (patch)
tree7c50f8aaf16d071701c0a9dc46f306d2349ce686
parent509484ba472c47e6ca4158fb84f55f1250763106 (diff)
downloadnss-hg-d52ffc22348f9c888f9c4a64ec74c7d786894956.tar.gz
Bug 181878: fixed two more bugs in the new code to support multiple email
addresses per certificate. r=nelsonb.
-rw-r--r--security/nss/lib/softoken/pcertdb.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/security/nss/lib/softoken/pcertdb.c b/security/nss/lib/softoken/pcertdb.c
index 68c2bd633..59600f70f 100644
--- a/security/nss/lib/softoken/pcertdb.c
+++ b/security/nss/lib/softoken/pcertdb.c
@@ -2246,7 +2246,6 @@ DecodeDBSubjectEntry(certDBEntrySubject *entry, SECItem *dbentry,
SECStatus rv;
unsigned int keyidoff;
unsigned int nnlen, eaddrlen;
- unsigned int nemailAddrs = 0;
unsigned int stdlen;
arena = entry->common.arena;
@@ -2369,7 +2368,7 @@ DecodeDBSubjectEntry(certDBEntrySubject *entry, SECItem *dbentry,
/* read in the additional email addresses */
entry->nemailAddrs = tmpbuf[0] << 8 | tmpbuf[1];
entry->emailAddrs = (char **)
- PORT_ArenaAlloc(arena, nemailAddrs * sizeof(char *));
+ PORT_ArenaAlloc(arena, entry->nemailAddrs * sizeof(char *));
if (entry->emailAddrs == NULL) {
PORT_SetError(SEC_ERROR_NO_MEMORY);
goto loser;
@@ -3699,7 +3698,7 @@ UpdateV6DB(NSSLOWCERTCertDBHandle *handle, DB *updatedb)
subjectEntry->emailAddrs = (char **)
PORT_ArenaAlloc(subjectEntry->common.arena,
- key.size - 1);
+ sizeof(char *));
if ( subjectEntry->emailAddrs ) {
subjectEntry->emailAddrs[0] =
(char *)PORT_ArenaAlloc(subjectEntry->common.arena,