httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cove...@apache.org
Subject svn commit: r634821 - in /httpd/httpd/trunk: CHANGES modules/ldap/util_ldap.c
Date Fri, 07 Mar 2008 21:02:42 GMT
Author: covener
Date: Fri Mar  7 13:02:41 2008
New Revision: 634821

URL: http://svn.apache.org/viewvc?rev=634821&view=rev
Log:
* mod_ldap: Correctly return all requested attribute values
when some attributes have a null value.

PR: 44560 
Submitted by: Anders Kaseorg <anders kaseorg.com>
Reviewed by: covener


Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/ldap/util_ldap.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=634821&r1=634820&r2=634821&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Fri Mar  7 13:02:41 2008
@@ -1,6 +1,10 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
+ 
+  *) mod_ldap: Correctly return all requested attribute values
+     when some attributes have a null value. 
+     PR 44560 [Anders Kaseorg <anders kaseorg.com>]
 
   *) core: check symlink ownership if both FollowSymlinks and
      SymlinksIfOwnerMatch are set [Nick Kew]

Modified: httpd/httpd/trunk/modules/ldap/util_ldap.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ldap/util_ldap.c?rev=634821&r1=634820&r2=634821&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ldap/util_ldap.c (original)
+++ httpd/httpd/trunk/modules/ldap/util_ldap.c Fri Mar  7 13:02:41 2008
@@ -1462,13 +1462,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]) {
-                        (*retvals)[i] = apr_pstrdup(r->pool,
-                                                    search_nodep->vals[i]);
-                        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]);
                     }
                 }
                 LDAP_CACHE_UNLOCK();
@@ -1712,13 +1709,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]) {
-                        (*retvals)[i] = apr_pstrdup(r->pool,
-                                                    search_nodep->vals[i]);
-                        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]);
                     }
                 }
                 LDAP_CACHE_UNLOCK();



Mime
View raw message