]> git.kaiwu.me - nginx.git/commitdiff
fix segfault introduced in r2602 if there is 502/504 error
authorIgor Sysoev <igor@sysoev.ru>
Mon, 30 Mar 2009 14:23:07 +0000 (14:23 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 30 Mar 2009 14:23:07 +0000 (14:23 +0000)
and proxy/fastcgi_cache is defined without proxy/fastcgi_cache_valid

src/http/ngx_http_file_cache.c

index 78f4773fc960dba4f60bf573a313621b85778dc1..0c23e46e05b1a37bf828135e32b4c05b814534d6 100644 (file)
@@ -1290,6 +1290,10 @@ ngx_http_file_cache_valid(ngx_array_t *cache_valid, ngx_uint_t status)
     ngx_uint_t               i;
     ngx_http_cache_valid_t  *valid;
 
+    if (cache_valid == NULL) {
+        return 0;
+    }
+
     valid = cache_valid->elts;
     for (i = 0; i < cache_valid->nelts; i++) {