[openssl] master update

Richard Levitte levitte at openssl.org
Tue Jun 29 07:33:34 UTC 2021


The branch master has been updated
       via  19c0b46b83335b36a9816abef4e82f74863a4e0a (commit)
      from  f616ad4b022b8afa8416a7d9e475d02c49164192 (commit)


- Log -----------------------------------------------------------------
commit 19c0b46b83335b36a9816abef4e82f74863a4e0a
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Jun 28 04:36:33 2021 +0200

    OSSL_STORE: Fix crash when tracing STORE
    
    Reviewed-by: Shane Lontis <shane.lontis at oracle.com>
    Reviewed-by: Paul Dale <pauli at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/15931)

-----------------------------------------------------------------------

Summary of changes:
 crypto/store/store_lib.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/crypto/store/store_lib.c b/crypto/store/store_lib.c
index 4b31c6f7d5..636a94e832 100644
--- a/crypto/store/store_lib.c
+++ b/crypto/store/store_lib.c
@@ -72,7 +72,7 @@ OSSL_STORE_open_ex(const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
     OSSL_STORE_CTX *ctx = NULL;
     char *propq_copy = NULL;
     int no_loader_found = 1;
-    char scheme_copy[256], *p, *schemes[2];
+    char scheme_copy[256], *p, *schemes[2], *scheme = NULL;
     size_t schemes_n = 0;
     size_t i;
 
@@ -111,9 +111,10 @@ OSSL_STORE_open_ex(const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
      * elsewhere.
      */
     for (i = 0; loader_ctx == NULL && i < schemes_n; i++) {
-        OSSL_TRACE1(STORE, "Looking up scheme %s\n", schemes[i]);
+        scheme = schemes[i];
+        OSSL_TRACE1(STORE, "Looking up scheme %s\n", scheme);
 #ifndef OPENSSL_NO_DEPRECATED_3_0
-        if ((loader = ossl_store_get0_loader_int(schemes[i])) != NULL) {
+        if ((loader = ossl_store_get0_loader_int(scheme)) != NULL) {
             no_loader_found = 0;
             if (loader->open_ex != NULL)
                 loader_ctx = loader->open_ex(loader, uri, libctx, propq,
@@ -124,7 +125,7 @@ OSSL_STORE_open_ex(const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
 #endif
         if (loader == NULL
             && (fetched_loader =
-                OSSL_STORE_LOADER_fetch(libctx, schemes[i], propq)) != NULL) {
+                OSSL_STORE_LOADER_fetch(libctx, scheme, propq)) != NULL) {
             const OSSL_PROVIDER *provider =
                 OSSL_STORE_LOADER_get0_provider(fetched_loader);
             void *provctx = OSSL_PROVIDER_get0_provider_ctx(provider);
@@ -151,7 +152,7 @@ OSSL_STORE_open_ex(const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
          */
         goto err;
 
-    OSSL_TRACE1(STORE, "Found loader for scheme %s\n", schemes[i]);
+    OSSL_TRACE1(STORE, "Found loader for scheme %s\n", scheme);
 
     if (loader_ctx == NULL)
         /*


More information about the openssl-commits mailing list