source: server/common/patches/httpd-2.2.x-broken-ldap-caching.patch @ 760

Last change on this file since 760 was 686, checked in by andersk, 16 years ago
tabs -> spaces.
File size: 1.7 KB
RevLine 
[685]1Index: httpd-2.2.x/modules/ldap/util_ldap.c
2===================================================================
3--- httpd-2.2.x/modules/ldap/util_ldap.c        (revision 634720)
4+++ httpd-2.2.x/modules/ldap/util_ldap.c        (working copy)
5@@ -925,12 +925,10 @@
6                 /* ...and entry is valid */
7                 *binddn = apr_pstrdup(r->pool, search_nodep->dn);
8                 if (attrs) {
9-                    int i = 0, k = 0;
10-                    while (attrs[k++]);
11-                    *retvals = apr_pcalloc(r->pool, sizeof(char *) * k);
12-                    while (search_nodep->vals[i]) {
13+                    int i;
14+                    *retvals = apr_pcalloc(r->pool, sizeof(char *) * search_nodep->numvals);
15+                    for (i = 0; i < search_nodep->numvals; i++) {
16                         (*retvals)[i] = apr_pstrdup(r->pool, search_nodep->vals[i]);
17-                        i++;
18                     }
19                 }
20                 LDAP_CACHE_UNLOCK();
21@@ -1174,12 +1172,10 @@
22                 /* ...and entry is valid */
23                 *binddn = apr_pstrdup(r->pool, search_nodep->dn);
24                 if (attrs) {
25-                    int i = 0, k = 0;
26-                    while (attrs[k++]);
27-                    *retvals = apr_pcalloc(r->pool, sizeof(char *) * k);
28-                    while (search_nodep->vals[i]) {
29+                    int i;
30+                    *retvals = apr_pcalloc(r->pool, sizeof(char *) * search_nodep->numvals);
[686]31+                    for (i = 0; i < search_nodep->numvals; i++) {
[685]32                         (*retvals)[i] = apr_pstrdup(r->pool, search_nodep->vals[i]);
33-                        i++;
34                     }
35                 }
36                 LDAP_CACHE_UNLOCK();
Note: See TracBrowser for help on using the repository browser.