You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ruediger Pluem <rp...@apache.org> on 2010/09/23 07:44:25 UTC

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


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

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

Posted by Graham Leggett <mi...@sharp.fm>.
On 23 Sep 2010, at 7:44 AM, Ruediger Pluem wrote:

>> -    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.

Indeed. Fixed in r1000395.

Regards,
Graham
--