From: Graham Leggett Date: Fri, 21 May 2004 23:49:10 +0000 (+0000) Subject: Fix a potential segfault if the bind password in the LDAP cache X-Git-Tag: 2.0.50~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a407ddff135ad8157a6c55af768052eaf73ce424;p=thirdparty%2Fapache%2Fhttpd.git Fix a potential segfault if the bind password in the LDAP cache is NULL. PR: 26686 Obtained from: Submitted by: Jari Ahonen 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 --- diff --git a/CHANGES b/CHANGES index c9545637529..5a3b9a0384a 100644 --- 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 ] + *) 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 b499561a91b..5aec2c5bb05 100644 --- 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 ] +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 ] - +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 diff --git a/modules/experimental/util_ldap_cache.c b/modules/experimental/util_ldap_cache.c index a279a57e010..c124df7240d 100644 --- a/modules/experimental/util_ldap_cache.c +++ b/modules/experimental/util_ldap_cache.c @@ -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; }