diff options
author | relyea%netscape.com <devnull@localhost> | 2002-02-27 16:59:33 +0000 |
---|---|---|
committer | relyea%netscape.com <devnull@localhost> | 2002-02-27 16:59:33 +0000 |
commit | b758fd836a6579016077823e0a6cf152803e8757 (patch) | |
tree | 806e080d999b95a16e83de9645b644a2c98ccaa8 | |
parent | 3780c4c5295c122ef163726f2f32ce69ea3e6f13 (diff) | |
download | nss-hg-b758fd836a6579016077823e0a6cf152803e8757.tar.gz |
Don't crash on when adding certs with null url's .
-rw-r--r-- | security/nss/lib/pk11wrap/pk11cert.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/security/nss/lib/pk11wrap/pk11cert.c b/security/nss/lib/pk11wrap/pk11cert.c index beea83ee3..1ef758328 100644 --- a/security/nss/lib/pk11wrap/pk11cert.c +++ b/security/nss/lib/pk11wrap/pk11cert.c @@ -3787,12 +3787,14 @@ PK11_PutCrl(PK11SlotInfo *slot, SECItem *crl, SECItem *name, PK11_SETATTRS(attrs, CKA_CLASS, &crlClass, sizeof(crlClass)); attrs++; PK11_SETATTRS(attrs, CKA_NETSCAPE_KRL, (type == SEC_CRL_TYPE) ? &ck_false : &ck_true, sizeof (CK_BBOOL)); attrs++; - PK11_SETATTRS(attrs, CKA_NETSCAPE_URL, url, PORT_Strlen(url)+1); attrs++; + if (url) { + PK11_SETATTRS(attrs, CKA_NETSCAPE_URL, url, PORT_Strlen(url)+1); attrs++; + } PK11_SETATTRS(attrs, CKA_VALUE,crl->data,crl->len); attrs++; PK11_SETATTRS(attrs, CKA_TOKEN, &ck_true,sizeof(CK_BBOOL)); attrs++; tsize = attrs - &theTemplate[0]; - PORT_Assert(tsize >= sizeof(theTemplate)/sizeof(theTemplate[0])); + PORT_Assert(tsize <= sizeof(theTemplate)/sizeof(theTemplate[0])); rwsession = PK11_GetRWSession(slot); if (rwsession == CK_INVALID_SESSION) { |