summaryrefslogtreecommitdiffstats
path: root/crypto/threads_pthread.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2021-02-18 21:31:56 +0100
committerPauli <ppzgs1@gmail.com>2021-03-14 06:33:34 +0100
commitcd3f8c1b11b0b9f4163bc8c62cbae38aec1b4030 (patch)
treede59d50b2ff9b2bd73a1ebf08eedf78d8ba44aa3 /crypto/threads_pthread.c
parentapps/ts.c: Allow -untrusted arg to refer to multiple sources (diff)
downloadopenssl-cd3f8c1b11b0b9f4163bc8c62cbae38aec1b4030.tar.xz
openssl-cd3f8c1b11b0b9f4163bc8c62cbae38aec1b4030.zip
Always check CRYPTO_LOCK_{read,write}_lock
Some functions that lock things are void, so we just return early. Also make ossl_namemap_empty return 0 on error. Updated the docs, and added some code to ossl_namemap_stored() to handle the failure, and updated the tests to allow for failure. Fixes: #14230 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14238)
Diffstat (limited to 'crypto/threads_pthread.c')
-rw-r--r--crypto/threads_pthread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c
index e81f3cf1ef..ecb53299c4 100644
--- a/crypto/threads_pthread.c
+++ b/crypto/threads_pthread.c
@@ -73,7 +73,7 @@ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
return lock;
}
-int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock)
+__owur int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock)
{
# ifdef USE_RWLOCK
if (pthread_rwlock_rdlock(lock) != 0)
@@ -88,7 +88,7 @@ int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock)
return 1;
}
-int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock)
+__owur int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock)
{
# ifdef USE_RWLOCK
if (pthread_rwlock_wrlock(lock) != 0)