From: Bradley Nicholes Date: Wed, 29 Sep 2004 17:22:53 +0000 (+0000) Subject: Fix the re-linking issue that was causing a segfault when purging elements from the... X-Git-Tag: 2.0.53~251 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67dcb4b6393b1889378a96ad604386f0148e5d37;p=thirdparty%2Fapache%2Fhttpd.git Fix the re-linking issue that was causing a segfault when purging elements from the LDAP cache. PR 24801 submitted by: [Jess Holle ] reviewed by: minfrin, bnicholes, clar git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@105343 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index b6944fad7ab..982b12c5103 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.53 + *) Fix the re-linking issue when purging elements from the LDAP cache + PR 24801 [Jess Holle ] + *) mod_disk_cache: Fix races in saving responses. [Justin Erenkrantz] *) Fix Expires handling in mod_cache. [Justin Erenkrantz] diff --git a/STATUS b/STATUS index 946c8e58a4d..dc02280a262 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2004/09/28 22:32:06 $] +Last modified at [$Date: 2004/09/29 17:22:50 $] Release: @@ -89,14 +89,6 @@ PATCHES TO BACKPORT FROM 2.1 modules/experimental/mod_disk_cache.c: 1.61 +1: jerenkrantz, stoddard - *) Fix a segfault in the LDAP cache purge. PR 24801 - modules/ldap/util_ldap_cache_mgr.c: 1.9, 1.10 - +1: minfrin, bnicholes, clar - bnicholes - backporting modules/ldap/util_ldap_cache_mgr.c: r1.7 below - should eliminate the need to backport the "else" condition included - in this patch. - minfrin: The excess "else" condition has been removed in v1.10. - *) mod_rewrite: Fix 0 bytes write into random memory position. PR 31036. (2.0 + 1.3) http://www.apache.org/~nd/dbmmap_1.3.patch diff --git a/modules/experimental/util_ldap_cache_mgr.c b/modules/experimental/util_ldap_cache_mgr.c index ff4ba369c49..20b5ceac44f 100644 --- a/modules/experimental/util_ldap_cache_mgr.c +++ b/modules/experimental/util_ldap_cache_mgr.c @@ -173,7 +173,7 @@ unsigned long util_ald_hash_string(int nstr, ...) void util_ald_cache_purge(util_ald_cache_t *cache) { unsigned long i; - util_cache_node_t *p, *q; + util_cache_node_t *p, *q, **pp; apr_time_t t; if (!cache) @@ -184,7 +184,8 @@ void util_ald_cache_purge(util_ald_cache_t *cache) cache->numpurges++; for (i=0; i < cache->size; ++i) { - p = cache->nodes[i]; + pp = cache->nodes + i; + p = *pp; while (p != NULL) { if (p->add_time < cache->marktime) { q = p->next; @@ -192,10 +193,11 @@ void util_ald_cache_purge(util_ald_cache_t *cache) util_ald_free(cache, p); cache->numentries--; cache->npurged++; - p = q; + p = *pp = q; } else { - p = p->next; + pp = &(p->next); + p = *pp; } } } @@ -688,6 +690,9 @@ char *util_ald_cache_display(request_rec *r, util_ldap_state_t *st) } } + else { + buf = ""; + } } else { ap_rputs("

\n"