mirror of
https://github.com/nginx/nginx.git
synced 2026-11-20 07:02:58 +00:00
Try files: fix uri formating in case of script underwrite
Previously, if try_files was used with alias, and the script produced
a string smaller than the predicted size, then an integer underflow
could happen which resulted in buffer overrun.
Fix is to recalculate the length after running the script.
A similar length recalculation exists in ngx_http_index_module.
It was added by 25f920eca when fixing script overruns.
Reported by Marc Luchian & Liviu-Alexandru Bud.
This commit is contained in:
parent
c4892abca6
commit
d1ffe6fa89
1 changed files with 1 additions and 0 deletions
|
|
@ -186,6 +186,7 @@ ngx_http_try_files_handler(ngx_http_request_t *r)
|
|||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
len = e.pos - name + 1;
|
||||
path.len = e.pos - path.data;
|
||||
|
||||
*e.pos = '\0';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue