Index: /server/common/patches/httpd-2.2.x-broken-ldap-caching.patch
===================================================================
--- /server/common/patches/httpd-2.2.x-broken-ldap-caching.patch	(revision 685)
+++ /server/common/patches/httpd-2.2.x-broken-ldap-caching.patch	(revision 685)
@@ -0,0 +1,36 @@
+Index: httpd-2.2.x/modules/ldap/util_ldap.c
+===================================================================
+--- httpd-2.2.x/modules/ldap/util_ldap.c	(revision 634720)
++++ httpd-2.2.x/modules/ldap/util_ldap.c	(working copy)
+@@ -925,12 +925,10 @@
+                 /* ...and entry is valid */
+                 *binddn = apr_pstrdup(r->pool, search_nodep->dn);
+                 if (attrs) {
+-                    int i = 0, k = 0;
+-                    while (attrs[k++]);
+-                    *retvals = apr_pcalloc(r->pool, sizeof(char *) * k);
+-                    while (search_nodep->vals[i]) {
++                    int i;
++                    *retvals = apr_pcalloc(r->pool, sizeof(char *) * search_nodep->numvals);
++                    for (i = 0; i < search_nodep->numvals; i++) {
+                         (*retvals)[i] = apr_pstrdup(r->pool, search_nodep->vals[i]);
+-                        i++;
+                     }
+                 }
+                 LDAP_CACHE_UNLOCK();
+@@ -1174,12 +1172,10 @@
+                 /* ...and entry is valid */
+                 *binddn = apr_pstrdup(r->pool, search_nodep->dn);
+                 if (attrs) {
+-                    int i = 0, k = 0;
+-                    while (attrs[k++]);
+-                    *retvals = apr_pcalloc(r->pool, sizeof(char *) * k);
+-                    while (search_nodep->vals[i]) {
++                    int i;
++                    *retvals = apr_pcalloc(r->pool, sizeof(char *) * search_nodep->numvals);
++		    for (i = 0; i < search_nodep->numvals; i++) {
+                         (*retvals)[i] = apr_pstrdup(r->pool, search_nodep->vals[i]);
+-                        i++;
+                     }
+                 }
+                 LDAP_CACHE_UNLOCK();
Index: /server/fedora/specs/httpd.spec.patch
===================================================================
--- /server/fedora/specs/httpd.spec.patch	(revision 684)
+++ /server/fedora/specs/httpd.spec.patch	(revision 685)
@@ -1,5 +1,5 @@
 --- httpd.spec.old	2006-09-08 15:04:31.000000000 -0400
 +++ httpd.spec	2006-09-16 21:32:05.000000000 -0400
-@@ -59,6 +59,9 @@
+@@ -59,6 +59,10 @@
  Obsoletes: mod_put, mod_roaming, mod_jk
  Conflicts: pcre < 4.0
@@ -7,9 +7,10 @@
 +Patch1000: httpd-suexec-scripts.patch
 +Patch1001: httpd-2.2.8-sni.patch
++Patch1002: httpd-2.2.x-broken-ldap-caching.patch
 +
  %description
  The Apache HTTP Server is a powerful, efficient, and extensible
  web server.
-@@ -127,6 +129,9 @@
+@@ -127,6 +129,10 @@
  # Patch in vendor/release string
  sed "s/@RELEASE@/%{vstring}/" < %{PATCH20} | patch -p1
@@ -17,4 +18,5 @@
 +%patch1000 -p1 -b .scripts
 +%patch1001 -p1 -b .sni
++%patch1002 -p1 -b .broken-ldap
 +
  # Safety check: prevent build if defined MMN does not equal upstream MMN.
