From: Graham Leggett Date: Fri, 21 May 2004 15:02:44 +0000 (+0000) Subject: Fix a potential segfault if the bind password in the LDAP cache X-Git-Tag: pre_ajp_proxy~244 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c142a7a377c75b239762316ba7abfc24bc92983a;p=apache Fix a potential segfault if the bind password in the LDAP cache is NULL. PR: 26686 Obtained from: Submitted by: Jari Ahonen Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103713 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 4fda184dca..fedc7cabd3 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) 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/modules/experimental/util_ldap_cache.c b/modules/experimental/util_ldap_cache.c index ac40694480..66206079cc 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; }