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();
