[nginx] Fixed null pointer dereference with $upstream_cache_last...

Ruslan Ermilov ru at nginx.com
Tue Dec 3 12:14:32 UTC 2013


details:   http://hg.nginx.org/nginx/rev/b7b8e2fa7ebd
branches:  
changeset: 5453:b7b8e2fa7ebd
user:      Ruslan Ermilov <ru at nginx.com>
date:      Tue Dec 03 15:11:24 2013 +0400
description:
Fixed null pointer dereference with $upstream_cache_last_modified.

diffstat:

 src/http/ngx_http_upstream.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r b7bf4671bb7b -r b7b8e2fa7ebd src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c	Fri Nov 29 17:23:47 2013 +0400
+++ b/src/http/ngx_http_upstream.c	Tue Dec 03 15:11:24 2013 +0400
@@ -4555,7 +4555,8 @@ ngx_http_upstream_cache_last_modified(ng
 {
     u_char  *p;
 
-    if (!r->upstream->conf->cache_revalidate
+    if (r->upstream == NULL
+        || !r->upstream->conf->cache_revalidate
         || r->upstream->cache_status != NGX_HTTP_CACHE_EXPIRED
         || r->cache->last_modified == -1)
     {



More information about the nginx-devel mailing list