* 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
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@227332
13f79535-47bb-0310-9956-
ffa450edef68
-*- 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
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
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;