potential null dereference

Maxim Dounin mdounin at mdounin.ru
Thu Feb 16 13:20:02 UTC 2017


On Thu, Feb 16, 2017 at 11:59:54AM +0800, alexc at sbrella.com wrote:

> In file /src/http/ngx_http_upstream.c, function
> ngx_http_upstream_finalize_request
> // if u->pipe == NULL, ngx_http_file_cache_free(r->cache, 
> u->pipe->temp_file); will dereference a null pointer, it's that 
> right ?

Sure.  _If_ u->pipe == NULL, ngx_http_file_cache_free() will 
dereference a null pointer.  But u->pipe == NULL with r->cache != NULL 
means a bug elsewhere.

As already suggested, the nginx-devel@ mailing list may be a better 
place for such questions.

Maxim Dounin

More information about the nginx mailing list