]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Fix a potential segfault if the bind password in the LDAP cache
authorGraham Leggett <minfrin@apache.org>
Fri, 21 May 2004 23:49:10 +0000 (23:49 +0000)
committerGraham Leggett <minfrin@apache.org>
Fri, 21 May 2004 23:49:10 +0000 (23:49 +0000)
is NULL.
PR: 26686
Obtained from:
Submitted by: Jari Ahonen <jah@progress.com>
Reviewed by: jim, trawick, bnicholes, minfrin

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@103732 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/experimental/util_ldap_cache.c

diff --git a/CHANGES b/CHANGES
index c9545637529cd977af629ab9e4b41562f969406c..5a3b9a0384a6a88affa4d3ebfa6e29d994ac5aeb 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.50
 
+  *) Fix a potential segfault if the bind password in the LDAP cache
+     is NULL. PR 26686 [Jari Ahonen <jah@progress.com>]
+
   *) Quotes cannot be used around require group and require dn
      directives, update the documentation to reflect this. Also add
      quotes around the dn and group within debug messages, to make it
diff --git a/STATUS b/STATUS
index b499561a91b35e702b5664c59a4c4cdc8146e7f6..5aec2c5bb05bcdf60650dcff9a04f4ade4bc46a5 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2004/05/21 23:39:41 $]
+Last modified at [$Date: 2004/05/21 23:49:10 $]
 
 Release:
 
@@ -79,12 +79,6 @@ PATCHES TO BACKPORT FROM 2.1
        PR 24922 [Pascal Terjan <pterjan@linuxfr.org>]
        +1: minfrin
 
-    *) Fix a potential segfault if the bind password in the LDAP cache
-       is NULL.
-       modules/experimental/util_ldap_cache.c r1.16
-       PR 26686 [Jari Ahonen <jah@progress.com>]
-       +1: jim, trawick, bnicholes
-
     *) Fix handling of IPv6 numeric strings in mod_proxy.
          modules/proxy/proxy_ftp.c r1.141, r1.142
          modules/proxy/proxy_http.c r1.186
index a279a57e0104e8b631e0fdec1179ad70ca2e9271..c124df7240de67e6bbb4ae67fa3441b3b8d869a6 100644 (file)
@@ -122,11 +122,18 @@ void *util_ldap_search_node_copy(util_ald_cache_t *cache, void *c)
             newnode->vals = NULL;
         }
         if (!(newnode->username = util_ald_strdup(cache, node->username)) ||
-            !(newnode->dn = util_ald_strdup(cache, node->dn)) ||
-            !(newnode->bindpw = util_ald_strdup(cache, node->bindpw)) ) {
+            !(newnode->dn = util_ald_strdup(cache, node->dn)) ) {
             util_ldap_search_node_free(cache, newnode);
             return NULL;
         }
+        if(node->bindpw) {
+            if(!(newnode->bindpw = util_ald_strdup(cache, node->bindpw))) {
+                util_ldap_search_node_free(cache, newnode);
+                return NULL;
+            }
+        } else {
+            newnode->bindpw = NULL;
+        }
         newnode->lastbind = node->lastbind;
 
     }