Skip to content

Commit

Permalink
Potential null pointer reference
Browse files Browse the repository at this point in the history
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #19429)
  • Loading branch information
yangyangtiantianlonglong authored and t8m committed Nov 2, 2022
1 parent 41e4f72 commit 15c8df8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/ectest.c
Expand Up @@ -2724,6 +2724,13 @@ static int custom_params_test(int id)
if (!TEST_ptr(ctx = BN_CTX_new()))
return 0;

BN_CTX_start(ctx);
if (!TEST_ptr(p = BN_CTX_get(ctx))
|| !TEST_ptr(a = BN_CTX_get(ctx))
|| !TEST_ptr(b = BN_CTX_get(ctx))
|| !TEST_ptr(k = BN_CTX_get(ctx)))
goto err;

if (!TEST_ptr(group = EC_GROUP_new_by_curve_name(nid)))
goto err;

Expand All @@ -2735,13 +2742,6 @@ static int custom_params_test(int id)
}
#endif

BN_CTX_start(ctx);
if (!TEST_ptr(p = BN_CTX_get(ctx))
|| !TEST_ptr(a = BN_CTX_get(ctx))
|| !TEST_ptr(b = BN_CTX_get(ctx))
|| !TEST_ptr(k = BN_CTX_get(ctx)))
goto err;

/* expected byte length of encoded points */
bsize = (EC_GROUP_get_degree(group) + 7) / 8;
bsize = 1 + 2 * bsize; /* UNCOMPRESSED_POINT format */
Expand Down

0 comments on commit 15c8df8

Please sign in to comment.