From 60a247a0677776be9817d2b38523e3483bc92e9c Mon Sep 17 00:00:00 2001 From: tb Date: Mon, 14 Oct 2024 18:17:11 +0000 Subject: [PATCH] Make NULL checks in ec_asn1_group2curve() explicit --- lib/libcrypto/ec/ec_asn1.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/libcrypto/ec/ec_asn1.c b/lib/libcrypto/ec/ec_asn1.c index 8d0f0329073..0fe187aeb1a 100644 --- a/lib/libcrypto/ec/ec_asn1.c +++ b/lib/libcrypto/ec/ec_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_asn1.c,v 1.71 2024/10/14 12:50:18 tb Exp $ */ +/* $OpenBSD: ec_asn1.c,v 1.72 2024/10/14 18:17:11 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -637,8 +637,10 @@ ec_asn1_group2curve(const EC_GROUP *group, X9_62_CURVE *curve) BIGNUM *a = NULL, *b = NULL; int ret = 0; - if (!group || !curve || !curve->a || !curve->b) - return 0; + if (group == NULL) + goto err; + if (curve == NULL || curve->a == NULL || curve->b == NULL) + goto err; if ((a = BN_new()) == NULL || (b = BN_new()) == NULL) { ECerror(ERR_R_MALLOC_FAILURE); -- 2.20.1