]> git.kaiwu.me - nginx.git/commitdiff
Fixed invalid access to location defined as an empty string.
authorRuslan Ermilov <ru@nginx.com>
Tue, 17 Jul 2018 12:30:43 +0000 (15:30 +0300)
committerRuslan Ermilov <ru@nginx.com>
Tue, 17 Jul 2018 12:30:43 +0000 (15:30 +0300)
src/http/modules/ngx_http_fastcgi_module.c
src/http/modules/ngx_http_grpc_module.c
src/http/modules/ngx_http_memcached_module.c
src/http/modules/ngx_http_proxy_module.c
src/http/modules/ngx_http_scgi_module.c
src/http/modules/ngx_http_uwsgi_module.c

index 3eec1b7dd0926c42422aef56bc4d81606f09d521..f73ff21374e18e6d50948c3a7fbb7280cb051bb0 100644 (file)
@@ -3501,7 +3501,7 @@ ngx_http_fastcgi_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 
     clcf->handler = ngx_http_fastcgi_handler;
 
-    if (clcf->name.data[clcf->name.len - 1] == '/') {
+    if (clcf->name.len && clcf->name.data[clcf->name.len - 1] == '/') {
         clcf->auto_redirect = 1;
     }
 
index 3bdf06a6aeb0c43c6bc0f0f4ea2c935944f19959..7fbf7366f2e8dcd00f20bb65da000aab8c142f6b 100644 (file)
@@ -4525,7 +4525,7 @@ ngx_http_grpc_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 
     clcf->handler = ngx_http_grpc_handler;
 
-    if (clcf->name.data[clcf->name.len - 1] == '/') {
+    if (clcf->name.len && clcf->name.data[clcf->name.len - 1] == '/') {
         clcf->auto_redirect = 1;
     }
 
index 82fa713232ce498e61dc66e3dc3b9f8e83302c24..2624471bbb8c88968e7de7deedd402c1c7d50621 100644 (file)
@@ -707,7 +707,7 @@ ngx_http_memcached_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 
     clcf->handler = ngx_http_memcached_handler;
 
-    if (clcf->name.data[clcf->name.len - 1] == '/') {
+    if (clcf->name.len && clcf->name.data[clcf->name.len - 1] == '/') {
         clcf->auto_redirect = 1;
     }
 
index d92407999a82ea61a12bf8d55d495c75bafab755..bc970077152ca185e7c449cb11b12615017b8950 100644 (file)
@@ -3580,7 +3580,7 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 
     clcf->handler = ngx_http_proxy_handler;
 
-    if (clcf->name.data[clcf->name.len - 1] == '/') {
+    if (clcf->name.len && clcf->name.data[clcf->name.len - 1] == '/') {
         clcf->auto_redirect = 1;
     }
 
index 9bd45bd136cdfdf153d335fd476936f52730920f..ab7769a2a3db7bc0fe36b4c80c465281e52776f0 100644 (file)
@@ -1857,7 +1857,7 @@ ngx_http_scgi_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
         return NGX_CONF_ERROR;
     }
 
-    if (clcf->name.data[clcf->name.len - 1] == '/') {
+    if (clcf->name.len && clcf->name.data[clcf->name.len - 1] == '/') {
         clcf->auto_redirect = 1;
     }
 
index 07a4c080511830356731ff1352904ffe131af1e6..0959133d12537b027758c2794a2cb3515ef7ec8a 100644 (file)
@@ -2144,7 +2144,7 @@ ngx_http_uwsgi_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
         return NGX_CONF_ERROR;
     }
 
-    if (clcf->name.data[clcf->name.len - 1] == '/') {
+    if (clcf->name.len && clcf->name.data[clcf->name.len - 1] == '/') {
         clcf->auto_redirect = 1;
     }