Variables: fixed buffer over-read when evaluating "$arg_".

This commit is contained in:
Sergey Kandaurov 2020-05-08 19:19:16 +03:00
parent ee9c61b89b
commit 41ecd45a5b

View File

@ -1075,7 +1075,7 @@ ngx_http_variable_argument(ngx_http_request_t *r, ngx_http_variable_value_t *v,
len = name->len - (sizeof("arg_") - 1);
arg = name->data + sizeof("arg_") - 1;
if (ngx_http_arg(r, arg, len, &value) != NGX_OK) {
if (len == 0 || ngx_http_arg(r, arg, len, &value) != NGX_OK) {
v->not_found = 1;
return NGX_OK;
}