summaryrefslogtreecommitdiffstats
path: root/crypto/cms
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2013-07-02 22:11:27 +0100
committerDr. Stephen Henson <steve@openssl.org>2013-07-02 22:12:19 +0100
commite0f7cfda68881da6829ea39430e1a5c28ed05ece (patch)
treed845ef53194a6c62f9d852de8641d639b0549e74 /crypto/cms
parentc256e69d3f3acd0794ae9c1f353f4093bd4c8878 (diff)
Initialise CMS signature buffer length properly.
Diffstat (limited to 'crypto/cms')
-rw-r--r--crypto/cms/cms_sd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/cms/cms_sd.c b/crypto/cms/cms_sd.c
index b7dbf52ab1..8f672890a0 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,