httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jess Holle <je...@ptc.com>
Subject Re: Last vote: LDAP crash / PR 24801
Date Thu, 23 Sep 2004 17:29:48 GMT
+1

Darn, I don't have a vote :-)

--
Jess Holle

Graham Leggett wrote:

> Hi all,
>
> Anyone willing to take a look at the following patch (then the latest 
> round of LDAP fixes are put to bed):
>
>     *) Fix a segfault in the LDAP cache purge. PR 24801
>          modules/ldap/util_ldap_cache_mgr.c: 1.9, 1.10
>        +1: minfrin, bnicholes
>        bnicholes - backporting modules/ldap/util_ldap_cache_mgr.c: 
> r1.7 below
>             should eliminate the need to backport the "else" condition 
> included
>             in this patch.
>        minfrin: The excess "else" condition has been removed in v1.10.
>
> ===================================================================
> RCS file: /home/cvspublic/httpd-2.0/modules/ldap/util_ldap_cache_mgr.c,v
> retrieving revision 1.8
> retrieving revision 1.9
> diff -u -r1.8 -r1.9
> --- httpd-2.0/modules/ldap/util_ldap_cache_mgr.c    2004/09/13 
> 11:11:32    1.8
> +++ httpd-2.0/modules/ldap/util_ldap_cache_mgr.c    2004/09/19 
> 23:00:25    1.9
> @@ -173,7 +173,7 @@
>  void util_ald_cache_purge(util_ald_cache_t *cache)
>  {
>      unsigned long i;
> -    util_cache_node_t *p, *q;
> +    util_cache_node_t *p, *q, **pp;
>      apr_time_t t;
>
>      if (!cache)
> @@ -184,7 +184,8 @@
>      cache->numpurges++;
>
>      for (i=0; i < cache->size; ++i) {
> -        p = cache->nodes[i];
> +        pp = cache->nodes + i;
> +        p = *pp;
>          while (p != NULL) {
>              if (p->add_time < cache->marktime) {
>                  q = p->next;
> @@ -192,10 +193,11 @@
>                  util_ald_free(cache, p);
>                  cache->numentries--;
>                  cache->npurged++;
> -                p = q;
> +                p = *pp = q;
>              }
>              else {
> -                p = p->next;
> +                pp = &(p->next);
> +                p = *pp;
>              }
>          }
>      }
>
> Regards,
> Graham
> -- 



Mime
View raw message