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
commitbee8e9204cf4b2cb0c53c4431da6ab1d54393c6d (patch)
tree9ff2c086d8c2e0bee50aa4ac1c66335139854c2a /src
parent939ccd0e181b428fca15e1490ea4674e1889b09e (diff)
downloadopenbsd-bee8e9204cf4b2cb0c53c4431da6ab1d54393c6d.tar.gz
openbsd-bee8e9204cf4b2cb0c53c4431da6ab1d54393c6d.tar.bz2
openbsd-bee8e9204cf4b2cb0c53c4431da6ab1d54393c6d.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);