src/http/modules/ngx_http_rewrite_module.c:936: error: Integer Overflow L2
  ([0, 9223372036854775800] + [0, 9]):signed64 by call to `ngx_http_rewrite_value`.

src/http/modules/ngx_http_rewrite_module.c:920:9: Call
918.     value[1].data++;
919. 
920.     v = ngx_http_add_variable(cf, &value[1],
             ^
921.                               NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_WEAK);
922.     if (v == NULL) {

src/http/ngx_http_variables.c:387:1: Parameter `*name->data`
  385. 
  386. 
  387. ngx_http_variable_t *
       ^
  388. ngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name, ngx_uint_t flags)
  389. {

src/http/modules/ngx_http_rewrite_module.c:926:13: Call
924.     }
925. 
926.     index = ngx_http_get_variable_index(cf, &value[1]);
                 ^
927.     if (index == NGX_ERROR) {
928.         return NGX_CONF_ERROR;

src/http/ngx_http_variables.c:517:1: Parameter `*name->data`
  515. 
  516. 
  517. ngx_int_t
       ^
  518. ngx_http_get_variable_index(ngx_conf_t *cf, ngx_str_t *name)
  519. {

src/http/modules/ngx_http_rewrite_module.c:936:9: Call
934.     }
935. 
936.     if (ngx_http_rewrite_value(cf, lcf, &value[2]) != NGX_CONF_OK) {
             ^
937.         return NGX_CONF_ERROR;
938.     }

src/http/modules/ngx_http_rewrite_module.c:967:1: Parameter `*value->data`
  965. 
  966. 
  967. static char *
       ^
  968. ngx_http_rewrite_value(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf,
  969.     ngx_str_t *value)

src/http/modules/ngx_http_rewrite_module.c:976:9: Call
  974.     ngx_http_script_complex_value_code_t  *complex;
  975. 
  976.     n = ngx_http_script_variables_count(value);
               ^
  977. 
  978.     if (n == 0) {

src/http/ngx_http_script.c:317:1: Parameter `*value->data`
    315. 
    316. 
    317. ngx_uint_t
         ^
    318. ngx_http_script_variables_count(ngx_str_t *value)
    319. {

src/http/modules/ngx_http_rewrite_module.c:985:13: Call
  983.         }
  984. 
  985.         n = ngx_atoi(value->data, value->len);
                   ^
  986. 
  987.         if (n == NGX_ERROR) {

src/core/ngx_string.c:910:5: <LHS trace>
908.     }
909. 
910.     cutoff = NGX_MAX_INT_T_VALUE / 10;
         ^
911.     cutlim = NGX_MAX_INT_T_VALUE % 10;
912. 

src/core/ngx_string.c:910:5: Assignment
    908.     }
    909. 
    910.     cutoff = NGX_MAX_INT_T_VALUE / 10;
             ^
    911.     cutlim = NGX_MAX_INT_T_VALUE % 10;
    912. 

src/core/ngx_string.c:901:1: <RHS trace>
899. 
900. 
901. ngx_int_t
     ^
902. ngx_atoi(u_char *line, size_t n)
903. {

src/core/ngx_string.c:901:1: Parameter `*line`
    899. 
    900. 
    901. ngx_int_t
         ^
    902. ngx_atoi(u_char *line, size_t n)
    903. {

src/core/ngx_string.c:922:9: Binary operation: ([0, 9223372036854775800] + [0, 9]):signed64 by call to `ngx_http_rewrite_value` 
    920.         }
    921. 
    922.         value = value * 10 + (*line - '0');
                 ^
    923.     }
    924. 

ngx_int_t
ngx_atoi(u_char *line, size_t n)
{
    ngx_int_t  value, cutoff, cutlim;
    if (n == 0) {
        return NGX_ERROR;
    }
    cutoff = NGX_MAX_INT_T_VALUE / 10;
    cutlim = NGX_MAX_INT_T_VALUE % 10;
    for (value = 0; n--; line++) {
        if (*line < '0' || *line > '9') {
            return NGX_ERROR;
        }
        if (value >= cutoff && (value > cutoff || *line - '0' > cutlim)) {
            return NGX_ERROR;
        }
        value = value * 10 + (*line - '0');
    }
    return value;
}
['static char *\nngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)\n{\n    ngx_http_rewrite_loc_conf_t  *lcf = conf;\n    ngx_int_t                            index;\n    ngx_str_t                           *value;\n    ngx_http_variable_t                 *v;\n    ngx_http_script_var_code_t          *vcode;\n    ngx_http_script_var_handler_code_t  *vhcode;\n    value = cf->args->elts;\n    if (value[1].data[0] != \'$\') {\n        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                           "invalid variable name \\"%V\\"", &value[1]);\n        return NGX_CONF_ERROR;\n    }\n    value[1].len--;\n    value[1].data++;\n    v = ngx_http_add_variable(cf, &value[1],\n                              NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_WEAK);\n    if (v == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    index = ngx_http_get_variable_index(cf, &value[1]);\n    if (index == NGX_ERROR) {\n        return NGX_CONF_ERROR;\n    }\n    if (v->get_handler == NULL) {\n        v->get_handler = ngx_http_rewrite_var;\n        v->data = index;\n    }\n    if (ngx_http_rewrite_value(cf, lcf, &value[2]) != NGX_CONF_OK) {\n        return NGX_CONF_ERROR;\n    }\n    if (v->set_handler) {\n        vhcode = ngx_http_script_start_code(cf->pool, &lcf->codes,\n                                   sizeof(ngx_http_script_var_handler_code_t));\n        if (vhcode == NULL) {\n            return NGX_CONF_ERROR;\n        }\n        vhcode->code = ngx_http_script_var_set_handler_code;\n        vhcode->handler = v->set_handler;\n        vhcode->data = v->data;\n        return NGX_CONF_OK;\n    }\n    vcode = ngx_http_script_start_code(cf->pool, &lcf->codes,\n                                       sizeof(ngx_http_script_var_code_t));\n    if (vcode == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    vcode->code = ngx_http_script_set_var_code;\n    vcode->index = (uintptr_t) index;\n    return NGX_CONF_OK;\n}', 'ngx_http_variable_t *\nngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name, ngx_uint_t flags)\n{\n    ngx_int_t                   rc;\n    ngx_uint_t                  i;\n    ngx_hash_key_t             *key;\n    ngx_http_variable_t        *v;\n    ngx_http_core_main_conf_t  *cmcf;\n    if (name->len == 0) {\n        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                           "invalid variable name \\"$\\"");\n        return NULL;\n    }\n    if (flags & NGX_HTTP_VAR_PREFIX) {\n        return ngx_http_add_prefix_variable(cf, name, flags);\n    }\n    cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);\n    key = cmcf->variables_keys->keys.elts;\n    for (i = 0; i < cmcf->variables_keys->keys.nelts; i++) {\n        if (name->len != key[i].key.len\n            || ngx_strncasecmp(name->data, key[i].key.data, name->len) != 0)\n        {\n            continue;\n        }\n        v = key[i].value;\n        if (!(v->flags & NGX_HTTP_VAR_CHANGEABLE)) {\n            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                               "the duplicate \\"%V\\" variable", name);\n            return NULL;\n        }\n        v->flags &= flags | ~NGX_HTTP_VAR_WEAK;\n        return v;\n    }\n    v = ngx_palloc(cf->pool, sizeof(ngx_http_variable_t));\n    if (v == NULL) {\n        return NULL;\n    }\n    v->name.len = name->len;\n    v->name.data = ngx_pnalloc(cf->pool, name->len);\n    if (v->name.data == NULL) {\n        return NULL;\n    }\n    ngx_strlow(v->name.data, name->data, name->len);\n    v->set_handler = NULL;\n    v->get_handler = NULL;\n    v->data = 0;\n    v->flags = flags;\n    v->index = 0;\n    rc = ngx_hash_add_key(cmcf->variables_keys, &v->name, v, 0);\n    if (rc == NGX_ERROR) {\n        return NULL;\n    }\n    if (rc == NGX_BUSY) {\n        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                           "conflicting variable name \\"%V\\"", name);\n        return NULL;\n    }\n    return v;\n}', 'ngx_int_t\nngx_http_get_variable_index(ngx_conf_t *cf, ngx_str_t *name)\n{\n    ngx_uint_t                  i;\n    ngx_http_variable_t        *v;\n    ngx_http_core_main_conf_t  *cmcf;\n    if (name->len == 0) {\n        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                           "invalid variable name \\"$\\"");\n        return NGX_ERROR;\n    }\n    cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);\n    v = cmcf->variables.elts;\n    if (v == NULL) {\n        if (ngx_array_init(&cmcf->variables, cf->pool, 4,\n                           sizeof(ngx_http_variable_t))\n            != NGX_OK)\n        {\n            return NGX_ERROR;\n        }\n    } else {\n        for (i = 0; i < cmcf->variables.nelts; i++) {\n            if (name->len != v[i].name.len\n                || ngx_strncasecmp(name->data, v[i].name.data, name->len) != 0)\n            {\n                continue;\n            }\n            return i;\n        }\n    }\n    v = ngx_array_push(&cmcf->variables);\n    if (v == NULL) {\n        return NGX_ERROR;\n    }\n    v->name.len = name->len;\n    v->name.data = ngx_pnalloc(cf->pool, name->len);\n    if (v->name.data == NULL) {\n        return NGX_ERROR;\n    }\n    ngx_strlow(v->name.data, name->data, name->len);\n    v->set_handler = NULL;\n    v->get_handler = NULL;\n    v->data = 0;\n    v->flags = 0;\n    v->index = cmcf->variables.nelts - 1;\n    return v->index;\n}', 'static char *\nngx_http_rewrite_value(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf,\n    ngx_str_t *value)\n{\n    ngx_int_t                              n;\n    ngx_http_script_compile_t              sc;\n    ngx_http_script_value_code_t          *val;\n    ngx_http_script_complex_value_code_t  *complex;\n    n = ngx_http_script_variables_count(value);\n    if (n == 0) {\n        val = ngx_http_script_start_code(cf->pool, &lcf->codes,\n                                         sizeof(ngx_http_script_value_code_t));\n        if (val == NULL) {\n            return NGX_CONF_ERROR;\n        }\n        n = ngx_atoi(value->data, value->len);\n        if (n == NGX_ERROR) {\n            n = 0;\n        }\n        val->code = ngx_http_script_value_code;\n        val->value = (uintptr_t) n;\n        val->text_len = (uintptr_t) value->len;\n        val->text_data = (uintptr_t) value->data;\n        return NGX_CONF_OK;\n    }\n    complex = ngx_http_script_start_code(cf->pool, &lcf->codes,\n                                 sizeof(ngx_http_script_complex_value_code_t));\n    if (complex == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    complex->code = ngx_http_script_complex_value_code;\n    complex->lengths = NULL;\n    ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));\n    sc.cf = cf;\n    sc.source = value;\n    sc.lengths = &complex->lengths;\n    sc.values = &lcf->codes;\n    sc.variables = n;\n    sc.complete_lengths = 1;\n    if (ngx_http_script_compile(&sc) != NGX_OK) {\n        return NGX_CONF_ERROR;\n    }\n    return NGX_CONF_OK;\n}', "ngx_uint_t\nngx_http_script_variables_count(ngx_str_t *value)\n{\n    ngx_uint_t  i, n;\n    for (n = 0, i = 0; i < value->len; i++) {\n        if (value->data[i] == '$') {\n            n++;\n        }\n    }\n    return n;\n}", "ngx_int_t\nngx_atoi(u_char *line, size_t n)\n{\n    ngx_int_t  value, cutoff, cutlim;\n    if (n == 0) {\n        return NGX_ERROR;\n    }\n    cutoff = NGX_MAX_INT_T_VALUE / 10;\n    cutlim = NGX_MAX_INT_T_VALUE % 10;\n    for (value = 0; n--; line++) {\n        if (*line < '0' || *line > '9') {\n            return NGX_ERROR;\n        }\n        if (value >= cutoff && (value > cutoff || *line - '0' > cutlim)) {\n            return NGX_ERROR;\n        }\n        value = value * 10 + (*line - '0');\n    }\n    return value;\n}"]