aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-03-10 14:45:41 +0000
committerIgor Sysoev <igor@sysoev.ru>2008-03-10 14:45:41 +0000
commitfb14092fdc9281b96dd6cd9715c834e07618d9c2 (patch)
treee596c0378b8e2d77017012f21c1741b03f8149df /src
parent15a20079a5c0619510fa2bbc73abbd38976d5f67 (diff)
downloadnginx-fb14092fdc9281b96dd6cd9715c834e07618d9c2.tar.gz
nginx-fb14092fdc9281b96dd6cd9715c834e07618d9c2.zip
fix large memory allocation in "error_page 495-497 /uri"
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_core_module.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 7f82d065d..08c1d352b 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -3559,7 +3559,22 @@ ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- err->overwrite = (overwrite >= 0) ? overwrite : err->status;
+ if (overwrite >= 0) {
+ err->overwrite = overwrite;
+
+ } else {
+ switch (err->status) {
+ case NGX_HTTP_TO_HTTPS:
+ case NGX_HTTPS_CERT_ERROR:
+ case NGX_HTTPS_NO_CERT:
+ err->overwrite = NGX_HTTP_BAD_REQUEST;
+ break;
+
+ default:
+ err->overwrite = err->status;
+ break;
+ }
+ }
err->uri = uri;
err->uri_lengths = uri_lengths;