summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-10-14 18:17:11 +0000
committertb <>2024-10-14 18:17:11 +0000
commit0cf982921c23ef66fd2a4a2a3a37bf97cc01ac00 (patch)
tree9ff2c086d8c2e0bee50aa4ac1c66335139854c2a /src
parent9f489e0460e5f709949277d482e23f717a09e9c3 (diff)
downloadopenbsd-0cf982921c23ef66fd2a4a2a3a37bf97cc01ac00.tar.gz
openbsd-0cf982921c23ef66fd2a4a2a3a37bf97cc01ac00.tar.bz2
openbsd-0cf982921c23ef66fd2a4a2a3a37bf97cc01ac00.zip
Make NULL checks in ec_asn1_group2curve() explicit
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/ec/ec_asn1.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/ec/ec_asn1.c b/src/lib/libcrypto/ec/ec_asn1.c
index 8d0f032907..0fe187aeb1 100644
--- a/src/lib/libcrypto/ec/ec_asn1.c
+++ b/src/lib/libcrypto/ec/ec_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_asn1.c,v 1.71 2024/10/14 12:50:18 tb Exp $ */ 1/* $OpenBSD: ec_asn1.c,v 1.72 2024/10/14 18:17:11 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -637,8 +637,10 @@ ec_asn1_group2curve(const EC_GROUP *group, X9_62_CURVE *curve)
637 BIGNUM *a = NULL, *b = NULL; 637 BIGNUM *a = NULL, *b = NULL;
638 int ret = 0; 638 int ret = 0;
639 639
640 if (!group || !curve || !curve->a || !curve->b) 640 if (group == NULL)
641 return 0; 641 goto err;
642 if (curve == NULL || curve->a == NULL || curve->b == NULL)
643 goto err;
642 644
643 if ((a = BN_new()) == NULL || (b = BN_new()) == NULL) { 645 if ((a = BN_new()) == NULL || (b = BN_new()) == NULL) {
644 ECerror(ERR_R_MALLOC_FAILURE); 646 ECerror(ERR_R_MALLOC_FAILURE);