]> git.kaiwu.me - nginx.git/commitdiff
Variables: fixed buffer over-read when evaluating "$arg_".
authorSergey Kandaurov <pluknet@nginx.com>
Fri, 8 May 2020 16:19:16 +0000 (19:19 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Fri, 8 May 2020 16:19:16 +0000 (19:19 +0300)
src/http/ngx_http_variables.c

index e067cf0c2dbe8993dbc506a3f55d30e349232f72..c2113c8436f24a1dd0529b68a41bc096f5cea2c5 100644 (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;
     }