summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2022-01-22 00:36:47 +0000
committerKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2022-01-22 00:36:47 +0000
commitf1f55b3fb15619f7c6e27a784353ea2b6c399fd2 (patch)
tree268dc33927850b90bf16d64c84b91a8c0f110726 /lib/libcrypto
parent6dfe2ad841b1f97c0c131386f2082a16e75a1ec1 (diff)
X509_GET_PUBKEY(3) return value check in libcrypto
CID 345116 ok beck@ tb@
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/x509/x509_vfy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libcrypto/x509/x509_vfy.c b/lib/libcrypto/x509/x509_vfy.c
index cf92c10299a..9a929963f3d 100644
--- a/lib/libcrypto/x509/x509_vfy.c
+++ b/lib/libcrypto/x509/x509_vfy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_vfy.c,v 1.100 2021/11/26 13:17:09 schwarze Exp $ */
+/* $OpenBSD: x509_vfy.c,v 1.101 2022/01/22 00:36:46 inoguchi Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -2096,7 +2096,8 @@ X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain)
/* first, populate the other certs */
for (j = i - 1; j >= 0; j--) {
- ktmp2 = X509_get0_pubkey(sk_X509_value(chain, j));
+ if ((ktmp2 = X509_get0_pubkey(sk_X509_value(chain, j))) == NULL)
+ return 0;
if (!EVP_PKEY_copy_parameters(ktmp2, ktmp))
return 0;
}