diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-06-27 21:57:58 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-07-05 17:45:50 +0100 |
commit | 68efafc513788863339c199d22048ef275832094 (patch) | |
tree | 2a409883db3b7f56d4571d77735c964bed640669 /crypto/pkcs7/pk7_attr.c | |
parent | c2d551c01930df54bce6517cfecd214db6e98e80 (diff) |
Add checks on sk_TYPE_push() returned value
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/pkcs7/pk7_attr.c')
-rw-r--r-- | crypto/pkcs7/pk7_attr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/pkcs7/pk7_attr.c b/crypto/pkcs7/pk7_attr.c index 5f7167048e..a96f41e1b9 100644 --- a/crypto/pkcs7/pk7_attr.c +++ b/crypto/pkcs7/pk7_attr.c @@ -74,7 +74,11 @@ int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg) alg->parameter->value.integer = nbit; alg->parameter->type = V_ASN1_INTEGER; } - sk_X509_ALGOR_push(sk, alg); + if (!sk_X509_ALGOR_push(sk, alg)) { + PKCS7err(PKCS7_F_PKCS7_SIMPLE_SMIMECAP, ERR_R_MALLOC_FAILURE); + X509_ALGOR_free(alg); + return 0; + } return 1; } |