]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_smime/lib/cmsencode.c
Security-57740.51.3.tar.gz
[apple/security.git] / OSX / libsecurity_smime / lib / cmsencode.c
index 2d0e51e614f5892d0a63e655c42424f4d89586e2..65d0f9ad83b11c01a89c2e7bf18d0310af21a6c2 100644 (file)
@@ -140,7 +140,6 @@ nss_cms_encoder_notify(void *arg, Boolean before, void *dest, int depth)
     SecCmsEncoderRef p7ecx;
     SecCmsContentInfoRef rootcinfo, cinfo;
     Boolean after = !before;
     SecCmsEncoderRef p7ecx;
     SecCmsContentInfoRef rootcinfo, cinfo;
     Boolean after = !before;
-    PLArenaPool *poolp;
     SECOidTag childtype;
     CSSM_DATA_PTR item;
 
     SECOidTag childtype;
     CSSM_DATA_PTR item;
 
@@ -148,7 +147,6 @@ nss_cms_encoder_notify(void *arg, Boolean before, void *dest, int depth)
     PORT_Assert(p7ecx != NULL);
 
     rootcinfo = &(p7ecx->cmsg->contentInfo);
     PORT_Assert(p7ecx != NULL);
 
     rootcinfo = &(p7ecx->cmsg->contentInfo);
-    poolp = p7ecx->cmsg->poolp;
 
 #ifdef CMSDEBUG
     fprintf(stderr, "%6.6s, dest = %p, depth = %d\n", before ? "before" : "after", dest, depth);
 
 #ifdef CMSDEBUG
     fprintf(stderr, "%6.6s, dest = %p, depth = %d\n", before ? "before" : "after", dest, depth);
@@ -225,12 +223,9 @@ nss_cms_before_data(SecCmsEncoderRef p7ecx)
     OSStatus rv;
     SECOidTag childtype;
     SecCmsContentInfoRef cinfo;
     OSStatus rv;
     SECOidTag childtype;
     SecCmsContentInfoRef cinfo;
-    PLArenaPool *poolp;
     SecCmsEncoderRef childp7ecx;
     const SecAsn1Template *template;
 
     SecCmsEncoderRef childp7ecx;
     const SecAsn1Template *template;
 
-    poolp = p7ecx->cmsg->poolp;
-
     /* call _Encode_BeforeData handlers */
     switch (p7ecx->type) {
     case SEC_OID_PKCS7_SIGNED_DATA:
     /* call _Encode_BeforeData handlers */
     switch (p7ecx->type) {
     case SEC_OID_PKCS7_SIGNED_DATA:
@@ -625,6 +620,10 @@ SecCmsEncoderUpdate(SecCmsEncoderRef p7ecx, const void *data, CFIndex len)
     SecCmsContentInfoRef cinfo;
     SECOidTag childtype;
 
     SecCmsContentInfoRef cinfo;
     SECOidTag childtype;
 
+    if (!p7ecx) {
+        return errSecParam;
+    }
+
     if (p7ecx->error)
        return p7ecx->error;
 
     if (p7ecx->error)
        return p7ecx->error;