src/http/modules/ngx_http_limit_conn_module.c:542: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned64 by call to `ngx_parse_size`.

src/http/modules/ngx_http_limit_conn_module.c:516:9: Call
514.     ccv.complex_value = &ctx->key;
515. 
516.     if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
             ^
517.         return NGX_CONF_ERROR;
518.     }

src/http/ngx_http_script.c:107:1: Parameter `*ccv->value->data`
  105. 
  106. 
  107. ngx_int_t
       ^
  108. ngx_http_compile_complex_value(ngx_http_compile_complex_value_t *ccv)
  109. {

src/http/modules/ngx_http_limit_conn_module.c:540:13: Assignment
538. 
539.             s.data = p + 1;
540.             s.len = value[i].data + value[i].len - s.data;
                 ^
541. 
542.             size = ngx_parse_size(&s);

src/http/modules/ngx_http_limit_conn_module.c:542:20: Call
540.             s.len = value[i].data + value[i].len - s.data;
541. 
542.             size = ngx_parse_size(&s);
                        ^
543. 
544.             if (size == NGX_ERROR) {

src/core/ngx_parse.c:12:1: <LHS trace>
10. 
11. 
12. ssize_t
    ^
13. ngx_parse_size(ngx_str_t *line)
14. {

src/core/ngx_parse.c:12:1: Parameter `line->len`
  10. 
  11. 
  12. ssize_t
      ^
  13. ngx_parse_size(ngx_str_t *line)
  14. {

src/core/ngx_parse.c:20:5: Assignment
  18.     ngx_int_t  scale;
  19. 
  20.     len = line->len;
          ^
  21.     unit = line->data[len - 1];
  22. 

src/core/ngx_parse.c:21:12: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ngx_parse_size` 
  19. 
  20.     len = line->len;
  21.     unit = line->data[len - 1];
                 ^
  22. 
  23.     switch (unit) {

ssize_t
ngx_parse_size(ngx_str_t *line)
{
    u_char     unit;
    size_t     len;
    ssize_t    size;
    ngx_int_t  scale;
    len = line->len;
    unit = line->data[len - 1];
    switch (unit) {
    case 'K':
    case 'k':
        len--;
        scale = 1024;
        break;
    case 'M':
    case 'm':
        len--;
        scale = 1024 * 1024;
        break;
    default:
        scale = 1;
    }
    size = ngx_atosz(line->data, len);
    if (size == NGX_ERROR) {
        return NGX_ERROR;
    }
    size *= scale;
    return size;
}
['static char *\nngx_http_limit_conn_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)\n{\n    u_char                            *p;\n    ssize_t                            size;\n    ngx_str_t                         *value, name, s;\n    ngx_uint_t                         i;\n    ngx_shm_zone_t                    *shm_zone;\n    ngx_http_limit_conn_ctx_t         *ctx;\n    ngx_http_compile_complex_value_t   ccv;\n    value = cf->args->elts;\n    ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_limit_conn_ctx_t));\n    if (ctx == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));\n    ccv.cf = cf;\n    ccv.value = &value[1];\n    ccv.complex_value = &ctx->key;\n    if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {\n        return NGX_CONF_ERROR;\n    }\n    size = 0;\n    name.len = 0;\n    for (i = 2; i < cf->args->nelts; i++) {\n        if (ngx_strncmp(value[i].data, "zone=", 5) == 0) {\n            name.data = value[i].data + 5;\n            p = (u_char *) ngx_strchr(name.data, \':\');\n            if (p == NULL) {\n                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                                   "invalid zone size \\"%V\\"", &value[i]);\n                return NGX_CONF_ERROR;\n            }\n            name.len = p - name.data;\n            s.data = p + 1;\n            s.len = value[i].data + value[i].len - s.data;\n            size = ngx_parse_size(&s);\n            if (size == NGX_ERROR) {\n                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                                   "invalid zone size \\"%V\\"", &value[i]);\n                return NGX_CONF_ERROR;\n            }\n            if (size < (ssize_t) (8 * ngx_pagesize)) {\n                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                                   "zone \\"%V\\" is too small", &value[i]);\n                return NGX_CONF_ERROR;\n            }\n            continue;\n        }\n        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                           "invalid parameter \\"%V\\"", &value[i]);\n        return NGX_CONF_ERROR;\n    }\n    if (name.len == 0) {\n        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                           "\\"%V\\" must have \\"zone\\" parameter",\n                           &cmd->name);\n        return NGX_CONF_ERROR;\n    }\n    shm_zone = ngx_shared_memory_add(cf, &name, size,\n                                     &ngx_http_limit_conn_module);\n    if (shm_zone == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    if (shm_zone->data) {\n        ctx = shm_zone->data;\n        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                           "%V \\"%V\\" is already bound to key \\"%V\\"",\n                           &cmd->name, &name, &ctx->key.value);\n        return NGX_CONF_ERROR;\n    }\n    shm_zone->init = ngx_http_limit_conn_init_zone;\n    shm_zone->data = ctx;\n    return NGX_CONF_OK;\n}', "ngx_int_t\nngx_http_compile_complex_value(ngx_http_compile_complex_value_t *ccv)\n{\n    ngx_str_t                  *v;\n    ngx_uint_t                  i, n, nv, nc;\n    ngx_array_t                 flushes, lengths, values, *pf, *pl, *pv;\n    ngx_http_script_compile_t   sc;\n    v = ccv->value;\n    nv = 0;\n    nc = 0;\n    for (i = 0; i < v->len; i++) {\n        if (v->data[i] == '$') {\n            if (v->data[i + 1] >= '1' && v->data[i + 1] <= '9') {\n                nc++;\n            } else {\n                nv++;\n            }\n        }\n    }\n    if ((v->len == 0 || v->data[0] != '$')\n        && (ccv->conf_prefix || ccv->root_prefix))\n    {\n        if (ngx_conf_full_name(ccv->cf->cycle, v, ccv->conf_prefix) != NGX_OK) {\n            return NGX_ERROR;\n        }\n        ccv->conf_prefix = 0;\n        ccv->root_prefix = 0;\n    }\n    ccv->complex_value->value = *v;\n    ccv->complex_value->flushes = NULL;\n    ccv->complex_value->lengths = NULL;\n    ccv->complex_value->values = NULL;\n    if (nv == 0 && nc == 0) {\n        return NGX_OK;\n    }\n    n = nv + 1;\n    if (ngx_array_init(&flushes, ccv->cf->pool, n, sizeof(ngx_uint_t))\n        != NGX_OK)\n    {\n        return NGX_ERROR;\n    }\n    n = nv * (2 * sizeof(ngx_http_script_copy_code_t)\n                  + sizeof(ngx_http_script_var_code_t))\n        + sizeof(uintptr_t);\n    if (ngx_array_init(&lengths, ccv->cf->pool, n, 1) != NGX_OK) {\n        return NGX_ERROR;\n    }\n    n = (nv * (2 * sizeof(ngx_http_script_copy_code_t)\n                   + sizeof(ngx_http_script_var_code_t))\n                + sizeof(uintptr_t)\n                + v->len\n                + sizeof(uintptr_t) - 1)\n            & ~(sizeof(uintptr_t) - 1);\n    if (ngx_array_init(&values, ccv->cf->pool, n, 1) != NGX_OK) {\n        return NGX_ERROR;\n    }\n    pf = &flushes;\n    pl = &lengths;\n    pv = &values;\n    ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));\n    sc.cf = ccv->cf;\n    sc.source = v;\n    sc.flushes = &pf;\n    sc.lengths = &pl;\n    sc.values = &pv;\n    sc.complete_lengths = 1;\n    sc.complete_values = 1;\n    sc.zero = ccv->zero;\n    sc.conf_prefix = ccv->conf_prefix;\n    sc.root_prefix = ccv->root_prefix;\n    if (ngx_http_script_compile(&sc) != NGX_OK) {\n        return NGX_ERROR;\n    }\n    if (flushes.nelts) {\n        ccv->complex_value->flushes = flushes.elts;\n        ccv->complex_value->flushes[flushes.nelts] = (ngx_uint_t) -1;\n    }\n    ccv->complex_value->lengths = lengths.elts;\n    ccv->complex_value->values = values.elts;\n    return NGX_OK;\n}", "ssize_t\nngx_parse_size(ngx_str_t *line)\n{\n    u_char     unit;\n    size_t     len;\n    ssize_t    size;\n    ngx_int_t  scale;\n    len = line->len;\n    unit = line->data[len - 1];\n    switch (unit) {\n    case 'K':\n    case 'k':\n        len--;\n        scale = 1024;\n        break;\n    case 'M':\n    case 'm':\n        len--;\n        scale = 1024 * 1024;\n        break;\n    default:\n        scale = 1;\n    }\n    size = ngx_atosz(line->data, len);\n    if (size == NGX_ERROR) {\n        return NGX_ERROR;\n    }\n    size *= scale;\n    return size;\n}"]