aboutsummaryrefslogtreecommitdiff
path: root/crypto/engine/eng_table.c
diff options
context:
space:
mode:
authorGordon Tetlow <gordon@FreeBSD.org>2024-09-04 03:56:17 +0000
committerGordon Tetlow <gordon@FreeBSD.org>2024-09-04 03:56:17 +0000
commit108164cf95d9594884c2dcccba2691335e6f221b (patch)
tree4e7056d88b26a82672d06a7aca8052b58615ca2f /crypto/engine/eng_table.c
parente60dbfd00b009d424dfc5446d132872c93dd0aed (diff)
Diffstat (limited to 'crypto/engine/eng_table.c')
-rw-r--r--crypto/engine/eng_table.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/engine/eng_table.c b/crypto/engine/eng_table.c
index 9dc3144bbfd7..6280965cc026 100644
--- a/crypto/engine/eng_table.c
+++ b/crypto/engine/eng_table.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2001-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2001-2024 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -215,9 +215,11 @@ ENGINE *ossl_engine_table_select(ENGINE_TABLE **table, int nid,
f, l, nid);
return NULL;
}
- ERR_set_mark();
+
if (!CRYPTO_THREAD_write_lock(global_engine_lock))
- goto end;
+ return NULL;
+
+ ERR_set_mark();
/*
* Check again inside the lock otherwise we could race against cleanup
* operations. But don't worry about a debug printout