httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: svn commit: r1000247 - in /httpd/httpd/trunk/modules/cache: cache_storage.c cache_storage.h cache_util.c cache_util.h mod_cache.h
Date Thu, 23 Sep 2010 05:44:25 GMT


On 09/22/2010 11:35 PM, minfrin@apache.org wrote:
> Author: minfrin
> Date: Wed Sep 22 21:35:38 2010
> New Revision: 1000247
> 
> URL: http://svn.apache.org/viewvc?rev=1000247&view=rev
> Log:
> Make cache_provider_list and cache_request_rec private by moving them
> out of mod_cache.h.
> 
> Modified:
>     httpd/httpd/trunk/modules/cache/cache_storage.c
>     httpd/httpd/trunk/modules/cache/cache_storage.h
>     httpd/httpd/trunk/modules/cache/cache_util.c
>     httpd/httpd/trunk/modules/cache/cache_util.h
>     httpd/httpd/trunk/modules/cache/mod_cache.h
> 
> Modified: httpd/httpd/trunk/modules/cache/cache_storage.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/cache_storage.c?rev=1000247&r1=1000246&r2=1000247&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/cache/cache_storage.c (original)
> +++ httpd/httpd/trunk/modules/cache/cache_storage.c Wed Sep 22 21:35:38 2010
> @@ -74,10 +74,18 @@ int cache_create_entity(cache_request_re
>  {
>      cache_provider_list *list;
>      cache_handle_t *h = apr_pcalloc(r->pool, sizeof(cache_handle_t));
> -    char *key;
>      apr_status_t rv;
>  
> -    rv = cache_generate_key(cache, r, r->pool, &key);
> +    if (!cache) {
> +        /* This should never happen */
> +        ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, r->server,
> +                     "cache: No cache request information available for key"
> +                     " generation");
> +        cache->key = "";

This creates a Segfault. We know that cache == NULL.

> +        return APR_EGENERAL;
> +    }
> +
> +    rv = cache_generate_key(r, r->pool, &cache->key);
>      if (rv != APR_SUCCESS) {
>          return rv;
>      }
> @@ -191,9 +199,17 @@ int cache_select(cache_request_rec *cach
>      cache_provider_list *list;
>      apr_status_t rv;
>      cache_handle_t *h;
> -    char *key;
>  
> -    rv = cache_generate_key(cache, r, r->pool, &key);
> +    if (!cache) {
> +        /* This should never happen */
> +        ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, r->server,
> +                     "cache: No cache request information available for key"
> +                     " generation");
> +        cache->key = "";

This creates a Segfault. We know that cache == NULL.


> +        return APR_EGENERAL;
> +    }
> +
> +    rv = cache_generate_key(r, r->pool, &cache->key);
>      if (rv != APR_SUCCESS) {
>          return rv;
>      }

Regards

RĂ¼diger

Mime
View raw message