x509: add the check for X509_STORE_lock
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Mon, 24 Jan 2022 09:03:25 +0000 (17:03 +0800)
committerTomas Mraz <tomas@openssl.org>
Wed, 26 Jan 2022 11:08:47 +0000 (12:08 +0100)
commit814999cb44135fd197945693a7c00cf0af784206
tree6e1eb605e24e73c7203daac76a90bfce04ab70a4
parent7625d70ad9e7be0588dd9453e89892c2b24b8175
x509: add the check for X509_STORE_lock

Since we may fail to get the lock, for example there is no lock, the
X509_STORE_lock() will return 0.
Therefore, we should check it in order to prevent the dirty data.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17575)
crypto/x509/x509_lu.c