X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/b04fe171f0375ecd5d8a24747ca1dff85720a0ca..6b200bc335dc93c5516ccb52f14bd896d8c7fad7:/libsecurity_smime/lib/cmsencode.c diff --git a/libsecurity_smime/lib/cmsencode.c b/libsecurity_smime/lib/cmsencode.c index 687badc5..e18a9492 100644 --- a/libsecurity_smime/lib/cmsencode.c +++ b/libsecurity_smime/lib/cmsencode.c @@ -124,7 +124,6 @@ nss_cms_encoder_notify(void *arg, Boolean before, void *dest, int depth) SecCmsEncoderRef p7ecx; SecCmsContentInfoRef rootcinfo, cinfo; Boolean after = !before; - PLArenaPool *poolp; SECOidTag childtype; SecAsn1Item * item; @@ -132,7 +131,6 @@ nss_cms_encoder_notify(void *arg, Boolean before, void *dest, int depth) PORT_Assert(p7ecx != NULL); rootcinfo = &(p7ecx->cmsg->contentInfo); - poolp = p7ecx->cmsg->poolp; #ifdef CMSDEBUG fprintf(stderr, "%6.6s, dest = 0x%08x, depth = %d\n", before ? "before" : "after", dest, depth); @@ -207,12 +205,9 @@ nss_cms_before_data(SecCmsEncoderRef p7ecx) OSStatus rv; SECOidTag childtype; SecCmsContentInfoRef cinfo; - PLArenaPool *poolp; SecCmsEncoderRef childp7ecx; const SecAsn1Template *template; - poolp = p7ecx->cmsg->poolp; - /* call _Encode_BeforeData handlers */ switch (p7ecx->type) { case SEC_OID_PKCS7_SIGNED_DATA: @@ -609,6 +604,10 @@ SecCmsEncoderUpdate(SecCmsEncoderRef p7ecx, const void *data, CFIndex len) SecCmsContentInfoRef cinfo; SECOidTag childtype; + if (!p7ecx) { + return errSecParam; + } + if (p7ecx->error) return p7ecx->error;