From: tb Date: Thu, 13 Apr 2023 05:25:30 +0000 (+0000) Subject: ectest: missing error checking X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9ec92463e617fca98bd7cb34f0d93f855913ed35;p=openbsd ectest: missing error checking CID 452228 --- diff --git a/regress/lib/libcrypto/ec/ectest.c b/regress/lib/libcrypto/ec/ectest.c index c4ef840ff2c..2b9c6a99f38 100644 --- a/regress/lib/libcrypto/ec/ectest.c +++ b/regress/lib/libcrypto/ec/ectest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ectest.c,v 1.12 2021/04/20 17:35:21 tb Exp $ */ +/* $OpenBSD: ectest.c,v 1.13 2023/04/13 05:25:30 tb Exp $ */ /* crypto/ec/ectest.c */ /* * Originally written by Bodo Moeller for the OpenSSL project. @@ -103,11 +103,17 @@ group_order_tests(EC_GROUP *group) BIGNUM *n1, *n2, *order; EC_POINT *P = EC_POINT_new(group); EC_POINT *Q = EC_POINT_new(group); - BN_CTX *ctx = BN_CTX_new(); + BN_CTX *ctx; - n1 = BN_new(); - n2 = BN_new(); - order = BN_new(); + if ((ctx = BN_CTX_new()) == NULL) + ABORT; + + if ((n1 = BN_new()) == NULL) + ABORT; + if ((n2 = BN_new()) == NULL) + ABORT; + if ((order = BN_new()) == NULL) + ABORT; fprintf(stdout, "verify group order ..."); fflush(stdout); if (!EC_GROUP_get_order(group, order, ctx))