summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs12
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-09-10 17:23:14 +0200
committerMatt Caswell <matt@openssl.org>2018-09-10 18:33:02 +0200
commit512d811719fc955f574090af4c3586a9aba46fa7 (patch)
tree1866ed1203f00280f8a4391792742061a2612db8 /crypto/pkcs12
parentValidate the SM2 digest len before use (diff)
downloadopenssl-512d811719fc955f574090af4c3586a9aba46fa7.tar.xz
openssl-512d811719fc955f574090af4c3586a9aba46fa7.zip
Check the return value from ASN1_INTEGER_set
Found by Coverity Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7169)
Diffstat (limited to 'crypto/pkcs12')
-rw-r--r--crypto/pkcs12/p12_init.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/pkcs12/p12_init.c b/crypto/pkcs12/p12_init.c
index a78e183c95..7b76909f02 100644
--- a/crypto/pkcs12/p12_init.c
+++ b/crypto/pkcs12/p12_init.c
@@ -22,7 +22,8 @@ PKCS12 *PKCS12_init(int mode)
PKCS12err(PKCS12_F_PKCS12_INIT, ERR_R_MALLOC_FAILURE);
return NULL;
}
- ASN1_INTEGER_set(pkcs12->version, 3);
+ if (!ASN1_INTEGER_set(pkcs12->version, 3))
+ goto err;
pkcs12->authsafes->type = OBJ_nid2obj(mode);
switch (mode) {
case NID_pkcs7_data: