summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2022-01-20 11:15:40 +0000
committerKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2022-01-20 11:15:40 +0000
commit1c9fc8950a335545c5ea17321df4e9b98ad8a0a6 (patch)
tree6bbb9a988c002bcd52c41573a7dcf368645660b1
parent4cf01169d390ce735fcabbc70100a61801846328 (diff)
Add check for ASN1_INTEGER_set
CID 24893 ok jsing@ millert@ tb@
-rw-r--r--lib/libcrypto/pkcs12/p12_init.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libcrypto/pkcs12/p12_init.c b/lib/libcrypto/pkcs12/p12_init.c
index 637c430bf47..7ae8d635bcd 100644
--- a/lib/libcrypto/pkcs12/p12_init.c
+++ b/lib/libcrypto/pkcs12/p12_init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: p12_init.c,v 1.11 2017/01/29 17:49:23 beck Exp $ */
+/* $OpenBSD: p12_init.c,v 1.12 2022/01/20 11:15:39 inoguchi Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
@@ -72,7 +72,8 @@ PKCS12_init(int mode)
PKCS12error(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: