diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-09-10 17:22:40 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-09-12 15:57:23 +1000 |
commit | 6e417f951c64f4643cdc62c370badf46d5fe485e (patch) | |
tree | 12911910cd502cced849d73b9915b2aa9508e144 /test | |
parent | 34816949460e7131af4de421806845be213354d4 (diff) |
Fix coverity issue: CID 1466485 - Explicit NULL dereference in OSSL_STORE_find()
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12847)
Diffstat (limited to 'test')
-rw-r--r-- | test/ossl_store_test.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/ossl_store_test.c b/test/ossl_store_test.c index cbae150099..9b48827983 100644 --- a/test/ossl_store_test.c +++ b/test/ossl_store_test.c @@ -24,13 +24,18 @@ static int test_store_open(void) { int ret = 0; OSSL_STORE_CTX *sctx = NULL; + OSSL_STORE_SEARCH *search = NULL; UI_METHOD *ui_method = NULL; - ret = TEST_ptr(ui_method= UI_create_method("DummyUI")) + ret = TEST_ptr(search = OSSL_STORE_SEARCH_by_alias("nothing")) + && TEST_ptr(ui_method= UI_create_method("DummyUI")) && TEST_ptr(sctx = OSSL_STORE_open_with_libctx(infile, NULL, NULL, ui_method, NULL, - NULL, NULL)); + NULL, NULL)) + && TEST_false(OSSL_STORE_find(sctx, NULL)) + && TEST_true(OSSL_STORE_find(sctx, search)); UI_destroy_method(ui_method); + OSSL_STORE_SEARCH_free(search); OSSL_STORE_close(sctx); return ret; } |