[PATCH] Add missing check for r->cache pointer validity in ngx_http_upstream_send_response()
    Maxim Dounin 
    mdounin at mdounin.ru
       
    Mon Apr 27 14:32:06 UTC 2020
    
    
  
Hello!
On Mon, Apr 27, 2020 at 02:16:37PM +0300, Andrey Kulikov wrote:
> In ngx_http_upstream_send_response() function there are a lot of
> checks for r->cache pointer validity.
> But it is absent for if (u->cacheable){}, which starts with dereferencing
>     valid = r->cache->valid_sec;
> straight away.
> 
> If this considered to be an issue - patch attempting to fix it is attached.
The u->cacheable is only expected to be set with r->cache, see 
ngx_http_upstream_cache().  If u->cacheable is set but r->cache is 
null, this indicates a bug elsewhere.
-- 
Maxim Dounin
http://mdounin.ru/
    
    
More information about the nginx-devel
mailing list