From 91bf1ecf54a3fc3a01a59aa8eb69c188801bb541 Mon Sep 17 00:00:00 2001 From: "nelsonb%netscape.com" Date: Sat, 23 Apr 2005 02:12:00 +0000 Subject: [PATCH] Prevent crash in certutil -C when incoming request has no attributes. Bug 291542. r=julien.pierre --- security/nss/cmd/certutil/certutil.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/security/nss/cmd/certutil/certutil.c b/security/nss/cmd/certutil/certutil.c index b26b5b7cafe7..6d4eab56b454 100644 --- a/security/nss/cmd/certutil/certutil.c +++ b/security/nss/cmd/certutil/certutil.c @@ -2184,7 +2184,10 @@ CreateCert( } if (certReq->attributes != NULL && - SECOID_FindOIDTag(&(*certReq->attributes)->attrType) + certReq->attributes[0] != NULL && + certReq->attributes[0]->attrType.data != NULL && + certReq->attributes[0]->attrType.len > 0 && + SECOID_FindOIDTag(&certReq->attributes[0]->attrType) == SEC_OID_PKCS9_EXTENSION_REQUEST) { rv = CERT_GetCertificateRequestExtensions(certReq, &CRexts); if (rv != SECSuccess)