mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
x509: fix coverity 1474424: data race condition
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14651)
This commit is contained in:
parent
96a68f21c3
commit
9aa4be691f
@ -73,8 +73,10 @@ int ossl_policy_cache_set_mapping(X509 *x, POLICY_MAPPINGS *maps)
|
||||
|
||||
ret = 1;
|
||||
bad_mapping:
|
||||
if (ret == -1)
|
||||
if (ret == -1 && CRYPTO_THREAD_write_lock(x->lock)) {
|
||||
x->ex_flags |= EXFLAG_INVALID_POLICY;
|
||||
CRYPTO_THREAD_unlock(x->lock);
|
||||
}
|
||||
sk_POLICY_MAPPING_pop_free(maps, POLICY_MAPPING_free);
|
||||
return ret;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user