]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
get_cert_by_subject_ex(): Check result of X509_STORE_lock()
authoratishkov <a.tishkov@aladdin.ru>
Fri, 21 Jul 2023 08:36:37 +0000 (11:36 +0300)
committerTomas Mraz <tomas@openssl.org>
Tue, 25 Jul 2023 15:05:08 +0000 (17:05 +0200)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21515)

(cherry picked from commit bc5d9cc8711e86d5c25b81c58dfae531536e61fc)

crypto/x509/by_dir.c

index 97e6ea0ee184b01a121c06e92dfa85257afff63c..63213ca2c821763c9b47381144d17cd9439fc18e 100644 (file)
@@ -349,7 +349,8 @@ static int get_cert_by_subject_ex(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
          * we have added it to the cache so now pull it out again
          */
         if (k > 0) {
-            X509_STORE_lock(xl->store_ctx);
+            if (!X509_STORE_lock(xl->store_ctx))
+                goto finish;
             j = sk_X509_OBJECT_find(xl->store_ctx->objs, &stmp);
             tmp = sk_X509_OBJECT_value(xl->store_ctx->objs, j);
             X509_STORE_unlock(xl->store_ctx);