diff options
author | yangyangtiantianlonglong <yangtianlong1224@163.com> | 2022-10-27 17:17:55 +0800 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-11-02 10:59:10 +0100 |
commit | 78ed5ab1d7073ff9885fe0f1f358160b06b294b1 (patch) | |
tree | b9d686afe4244ec4566b3baf68bca87d86b6fb76 /test | |
parent | 7f6bf5cdac7db6e3c0bb03acfaa8ddbeb9b97518 (diff) |
Potential null pointer reference
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19429)
(cherry picked from commit 15c8df81083f31dd35aedbe2d58ec702d0c0dc65)
Diffstat (limited to 'test')
-rw-r--r-- | test/ectest.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/ectest.c b/test/ectest.c index 38772ba16f..946973c2f4 100644 --- a/test/ectest.c +++ b/test/ectest.c @@ -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; @@ -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 */ |