httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r227332 - in /httpd/httpd/branches/2.0.x: CHANGES STATUS modules/experimental/util_ldap_cache_mgr.c
Date Thu, 04 Aug 2005 09:42:47 GMT
Author: jorton
Date: Thu Aug  4 02:42:43 2005
New Revision: 227332

URL: http://svn.apache.org/viewcvs?rev=227332&view=rev
Log:
Merge r225746 from trunk:

* modules/ldap/util_ldap_cache_mgr.c (util_ald_cache_insert): Fix a
cache corruption case: ensure that there is room in the cache for a
copy of the payload before inserting the node.

PR: 34209
Reviewed by: jorton, bnicholes, minfrin

Modified:
    httpd/httpd/branches/2.0.x/CHANGES
    httpd/httpd/branches/2.0.x/STATUS
    httpd/httpd/branches/2.0.x/modules/experimental/util_ldap_cache_mgr.c

Modified: httpd/httpd/branches/2.0.x/CHANGES
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/CHANGES?rev=227332&r1=227331&r2=227332&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.0.x/CHANGES [utf-8] Thu Aug  4 02:42:43 2005
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.0.55
 
+  *) mod_ldap: Fix a possible crash in shared memory cache handling.
+     PR 34209.  [Joe Orton]
+
   *) Fix a file descriptor leak when starting piped loggers.  [Joe Orton]
 
   *) mod_ldap: Avoid segfaults when opening connections if using a version

Modified: httpd/httpd/branches/2.0.x/STATUS
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/STATUS?rev=227332&r1=227331&r2=227332&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/STATUS (original)
+++ httpd/httpd/branches/2.0.x/STATUS Thu Aug  4 02:42:43 2005
@@ -378,11 +378,6 @@
         http://svn.apache.org/viewcvs.cgi?rev=209539&view=rev
         +1: pquerna
 
-     *) mod_ldap: Fix cache corruption case.
-        http://svn.apache.org/viewcvs?rev=225746&view=rev
-        PR: 34209
-        +1: jorton, bnicholes, minfrin
-
      *) mod_ldap: Use the correct shm segment size, fail on
         apr_rmm_init errors.
         http://svn.apache.org/viewcvs?rev=225753&view=rev

Modified: httpd/httpd/branches/2.0.x/modules/experimental/util_ldap_cache_mgr.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/modules/experimental/util_ldap_cache_mgr.c?rev=227332&r1=227331&r2=227332&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/modules/experimental/util_ldap_cache_mgr.c (original)
+++ httpd/httpd/branches/2.0.x/modules/experimental/util_ldap_cache_mgr.c Thu Aug  4 02:42:43
2005
@@ -402,11 +402,18 @@
         return NULL;
     }
 
+    /* Take a copy of the payload before proceeeding. */
+    payload = (*cache->copy)(cache, payload);
+    if (!payload) {
+        util_ald_free(cache, node);
+        return NULL;
+    }
+
     /* populate the entry */
     cache->inserts++;
     hashval = (*cache->hash)(payload) % cache->size;
     node->add_time = apr_time_now();
-    node->payload = (*cache->copy)(cache, payload);
+    node->payload = payload;
     node->next = cache->nodes[hashval];
     cache->nodes[hashval] = node;
 



Mime
View raw message