aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_script.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-08-23 15:36:54 +0000
committerIgor Sysoev <igor@sysoev.ru>2005-08-23 15:36:54 +0000
commitb85fd593e08b8f27a18fb7e2feda02f01d9db15d (patch)
tree42cb06ce67a69d1eba948ecc9733b6465e4bbf6f /src/http/ngx_http_script.c
parent25e571ff74c1d649d0bee724250a66852f3b062c (diff)
downloadnginx-b85fd593e08b8f27a18fb7e2feda02f01d9db15d.tar.gz
nginx-b85fd593e08b8f27a18fb7e2feda02f01d9db15d.zip
nginx-0.1.42-RELEASE importrelease-0.1.42
*) Bugfix: if the request URI had a zero length after the processing in the ngx_http_proxy_module, then the segmentation fault or bus error occurred in the ngx_http_proxy_module. *) Bugfix: the "limit_rate" directive did not work inside the "if" block; the bug had appeared in 0.1.38.
Diffstat (limited to 'src/http/ngx_http_script.c')
-rw-r--r--src/http/ngx_http_script.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c
index 716a6f054..27c9ce045 100644
--- a/src/http/ngx_http_script.c
+++ b/src/http/ngx_http_script.c
@@ -687,6 +687,14 @@ ngx_http_script_regex_end_code(ngx_http_script_engine_t *e)
if (code->uri) {
r->uri = e->buf;
+ if (r->uri.len == 0) {
+ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+ "the rewritten URI has a zero length");
+ e->ip = ngx_http_script_exit;
+ e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
+ return;
+ }
+
if (ngx_http_set_exten(r) != NGX_OK) {
e->ip = ngx_http_script_exit;
e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
@@ -737,6 +745,7 @@ ngx_http_script_if_code(ngx_http_script_engine_t *e)
if (e->sp->value) {
if (code->loc_conf) {
e->request->loc_conf = code->loc_conf;
+ ngx_http_update_location_config(e->request);
}
e->ip += sizeof(ngx_http_script_if_code_t);