]> granicus.if.org Git - apache/commitdiff
* modules/ldap/util_ldap.c (util_ldap_post_config): Fix false
authorJoe Orton <jorton@apache.org>
Mon, 13 Sep 2004 10:59:55 +0000 (10:59 +0000)
committerJoe Orton <jorton@apache.org>
Mon, 13 Sep 2004 10:59:55 +0000 (10:59 +0000)
positives from gcc -Wformat-security.

* modules/ldap/util_ldap_cache.c (util_ldap_url_node_display): Add default
to switch to avoid uninitialised variable warnings.

* modules/ldap/util_ldap_cache_mgr.c (util_ald_create_caches): Fix to
return NULL rather than random chunk from stack on error path.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105105 13f79535-47bb-0310-9956-ffa450edef68

modules/ldap/util_ldap.c
modules/ldap/util_ldap_cache.c
modules/ldap/util_ldap_cache_mgr.c

index c579bf3a662e3e1f167a64e4b622e8c6c8bd4253..3258c714118cc29ce5f03dd275a814e7c417cbca 100644 (file)
@@ -1223,7 +1223,7 @@ static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog,
         apr_ldap_err_t *result = NULL;
         apr_ldap_info(p, &(result));
         if (result != NULL) {
-            ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s, result->reason);
+            ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s, "%s", result->reason);
         }
     }
 
@@ -1244,7 +1244,7 @@ static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog,
             st->ssl_support = 1;
         }
         else if (NULL != result) {
-            ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, result->reason);
+            ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, "%s", result->reason);
             st->ssl_support = 0;
         }
 
index 47547d623a717f9d3106844d7f4fb3deab63ff43..6be03b32316425322de48b35c3269a9103552732 100644 (file)
@@ -99,6 +99,7 @@ void util_ldap_url_node_display(request_rec *r, util_ald_cache_t *cache, void *n
                 type_str = "Compares";
                 break;
             case 2:
+            default:
                 cache_node = node->dn_compare_cache;
                 type_str = "DN Compares";
                 break;
index 31b297e552bb0b33c76115c9e56ab65a1fa6f744..373843e5b7ca5ad742ff13e9159694dbbc2dcde9 100644 (file)
@@ -212,7 +212,7 @@ void util_ald_cache_purge(util_ald_cache_t *cache)
  */
 util_url_node_t *util_ald_create_caches(util_ldap_state_t *st, const char *url)
 {
-    util_url_node_t curl, *newcurl;
+    util_url_node_t curl, *newcurl = NULL;
     util_ald_cache_t *search_cache;
     util_ald_cache_t *compare_cache;
     util_ald_cache_t *dn_compare_cache;