From: Graham Leggett Date: Sun, 3 Oct 2004 16:24:53 +0000 (+0000) Subject: mod_ldap: prevent the possiblity of an infinite loop in the LDAP X-Git-Tag: 2.1.1~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74fd534f2beaf78f6fef22ce21a3931a477ce0d6;p=thirdparty%2Fapache%2Fhttpd.git mod_ldap: prevent the possiblity of an infinite loop in the LDAP statistics display. PR: 29216 Obtained from: Submitted by: Graham Leggett Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105373 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index a751e4219b1..ccff568a693 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] + *) mod_ldap: prevent the possiblity of an infinite loop in the LDAP + statistics display. PR 29216 [Graham Leggett] + *) mod_disk_cache: Do not store hop-by-hop headers. [Justin Erenkrantz] *) mod_cache: Try to correctly follow RFC 2616 13.3 on validating stale diff --git a/modules/ldap/util_ldap_cache_mgr.c b/modules/ldap/util_ldap_cache_mgr.c index a46bcc93161..f9a74429c42 100644 --- a/modules/ldap/util_ldap_cache_mgr.c +++ b/modules/ldap/util_ldap_cache_mgr.c @@ -469,8 +469,11 @@ char *util_ald_cache_display_stats(request_rec *r, util_ald_cache_t *cache, char for (i=0; i < cache->size; ++i) { if (cache->nodes[i] != NULL) { nchains++; - for (n = cache->nodes[i]; n != NULL; n = n->next) - totchainlen++; + for (n = cache->nodes[i]; + n != NULL && n != n->next; + n = n->next) { + totchainlen++; + } } } chainlen = nchains? (double)totchainlen / (double)nchains : 0;