From: Dr. Stephen Henson Date: Tue, 2 Jul 2013 21:11:27 +0000 (+0100) Subject: Initialise CMS signature buffer length properly. X-Git-Tag: OpenSSL_1_0_2-beta1~236 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=869772ff08fceb1082750572ce131af78f30d96e;p=openssl Initialise CMS signature buffer length properly. (cherry picked from commit e0f7cfda68881da6829ea39430e1a5c28ed05ece) --- diff --git a/crypto/cms/cms_sd.c b/crypto/cms/cms_sd.c index b7eb9626e7..25af94136a 100644 --- a/crypto/cms/cms_sd.c +++ b/crypto/cms/cms_sd.c @@ -700,7 +700,8 @@ static int cms_SignerInfo_content_sign(CMS_ContentInfo *cms, pctx = si->pctx; if (!EVP_DigestFinal_ex(&mctx, md, &mdlen)) goto err; - sig = OPENSSL_malloc(EVP_PKEY_size(si->pkey)); + siglen = EVP_PKEY_size(si->pkey); + sig = OPENSSL_malloc(siglen); if (!sig) { CMSerr(CMS_F_CMS_SIGNERINFO_CONTENT_SIGN,