]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Fix the re-linking issue that was causing a segfault when purging elements from the...
authorBradley Nicholes <bnicholes@apache.org>
Wed, 29 Sep 2004 17:22:53 +0000 (17:22 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Wed, 29 Sep 2004 17:22:53 +0000 (17:22 +0000)
PR 24801

submitted by: [Jess Holle <jessh ptc.com>]
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

CHANGES
STATUS
modules/experimental/util_ldap_cache_mgr.c

diff --git a/CHANGES b/CHANGES
index b6944fad7ab3b7732b942818aeaa139d4857eb12..982b12c5103c9d4e99ae347cbcbb18e51b56b975 100644 (file)
--- 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 <jessh ptc.com>]
+      
   *) 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 946c8e58a4d401d29a8cb3bbae412d982769b352..dc02280a262e126f1519445fb0b1322d8fbe2cbb 100644 (file)
--- 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
index ff4ba369c4911df291f091e6ecd00e3e408ff2c3..20b5ceac44f738df878b82cd524485e42edb52b4 100644 (file)
@@ -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("<p>\n"