summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorinoguchi <>2022-01-20 11:18:49 +0000
committerinoguchi <>2022-01-20 11:18:49 +0000
commit8d9b15a708ee90bc4066e50bb8c933fc0a425f14 (patch)
tree61821a80b7ec9f5c913c59e8bdf72027770e7152 /src
parent323a2e41e712066327b8adb07991a7fa32921910 (diff)
downloadopenbsd-8d9b15a708ee90bc4066e50bb8c933fc0a425f14.tar.gz
openbsd-8d9b15a708ee90bc4066e50bb8c933fc0a425f14.tar.bz2
openbsd-8d9b15a708ee90bc4066e50bb8c933fc0a425f14.zip
Add check for OBJ_nid2obj return value
input from tb@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/pkcs12/p12_init.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libcrypto/pkcs12/p12_init.c b/src/lib/libcrypto/pkcs12/p12_init.c
index 7ae8d635bc..13dbe3664a 100644
--- a/src/lib/libcrypto/pkcs12/p12_init.c
+++ b/src/lib/libcrypto/pkcs12/p12_init.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_init.c,v 1.12 2022/01/20 11:15:39 inoguchi Exp $ */ 1/* $OpenBSD: p12_init.c,v 1.13 2022/01/20 11:18:49 inoguchi Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -74,7 +74,8 @@ PKCS12_init(int mode)
74 } 74 }
75 if (!ASN1_INTEGER_set(pkcs12->version, 3)) 75 if (!ASN1_INTEGER_set(pkcs12->version, 3))
76 goto err; 76 goto err;
77 pkcs12->authsafes->type = OBJ_nid2obj(mode); 77 if ((pkcs12->authsafes->type = OBJ_nid2obj(mode)) == NULL)
78 goto err;
78 switch (mode) { 79 switch (mode) {
79 case NID_pkcs7_data: 80 case NID_pkcs7_data:
80 if (!(pkcs12->authsafes->d.data = 81 if (!(pkcs12->authsafes->d.data =