coverity 1464984: Null pointer dereferences
authorPauli <paul.dale@oracle.com>
Sun, 28 Jun 2020 22:33:35 +0000 (08:33 +1000)
committerPauli <paul.dale@oracle.com>
Sun, 5 Jul 2020 03:20:09 +0000 (13:20 +1000)
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12309)

crypto/property/property.c

index a72ccb02b4d6f5d46a3f4df2617e3a75ca9e48ba..a3b52ee44d54fac72e690de2f5946d646d2c0b51 100644 (file)
@@ -324,7 +324,7 @@ int ossl_method_store_fetch(OSSL_METHOD_STORE *store, int nid,
                             const char *prop_query,
                             void **method)
 {
-    OSSL_PROPERTY_LIST **plp = ossl_ctx_global_properties(store->ctx);
+    OSSL_PROPERTY_LIST **plp;
     ALGORITHM *alg;
     IMPLEMENTATION *impl;
     OSSL_PROPERTY_LIST *pq = NULL, *p2 = NULL;
@@ -350,9 +350,9 @@ int ossl_method_store_fetch(OSSL_METHOD_STORE *store, int nid,
         return 0;
     }
 
-    if (prop_query != NULL) {
+    if (prop_query != NULL)
         p2 = pq = ossl_parse_query(store->ctx, prop_query);
-    }
+    plp = ossl_ctx_global_properties(store->ctx);
     if (plp != NULL && *plp != NULL) {
         if (pq == NULL) {
             pq = *plp;