From: Joe Orton Date: Mon, 13 Sep 2004 10:59:55 +0000 (+0000) Subject: * modules/ldap/util_ldap.c (util_ldap_post_config): Fix false X-Git-Tag: 2.1.1~278 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=733fefe0b85ed969c0e3b7f77fa4f6a142562077;p=thirdparty%2Fapache%2Fhttpd.git * modules/ldap/util_ldap.c (util_ldap_post_config): Fix false 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 --- diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c index c579bf3a662..3258c714118 100644 --- a/modules/ldap/util_ldap.c +++ b/modules/ldap/util_ldap.c @@ -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; } diff --git a/modules/ldap/util_ldap_cache.c b/modules/ldap/util_ldap_cache.c index 47547d623a7..6be03b32316 100644 --- a/modules/ldap/util_ldap_cache.c +++ b/modules/ldap/util_ldap_cache.c @@ -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; diff --git a/modules/ldap/util_ldap_cache_mgr.c b/modules/ldap/util_ldap_cache_mgr.c index 31b297e552b..373843e5b7c 100644 --- a/modules/ldap/util_ldap_cache_mgr.c +++ b/modules/ldap/util_ldap_cache_mgr.c @@ -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;