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

src/http/modules/ngx_http_upstream_zone_module.c:80:12: Call
78.     }
79. 
80.     size = ngx_parse_size(&value[2]);
               ^
81. 
82.     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:19:5: Assignment
  17.     ssize_t  size, scale, max;
  18. 
  19.     len = line->len;
          ^
  20.     unit = line->data[len - 1];
  21. 

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

ssize_t
ngx_parse_size(ngx_str_t *line)
{
    u_char   unit;
    size_t   len;
    ssize_t  size, scale, max;
    len = line->len;
    unit = line->data[len - 1];
    switch (unit) {
    case 'K':
    case 'k':
        len--;
        max = NGX_MAX_SIZE_T_VALUE / 1024;
        scale = 1024;
        break;
    case 'M':
    case 'm':
        len--;
        max = NGX_MAX_SIZE_T_VALUE / (1024 * 1024);
        scale = 1024 * 1024;
        break;
    default:
        max = NGX_MAX_SIZE_T_VALUE;
        scale = 1;
    }
    size = ngx_atosz(line->data, len);
    if (size == NGX_ERROR || size > max) {
        return NGX_ERROR;
    }
    size *= scale;
    return size;
}
['static char *\nngx_http_upstream_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)\n{\n    ngx_http_upstream_srv_conf_t  *uscf;\n    ssize_t                        size;\n    ngx_str_t                     *value;\n    uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);\n    value = cf->args->elts;\n    if (!value[1].len) {\n        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                           "invalid zone name \\"%V\\"", &value[1]);\n        return NGX_CONF_ERROR;\n    }\n    size = ngx_parse_size(&value[2]);\n    if (size == NGX_ERROR) {\n        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                           "invalid zone size \\"%V\\"", &value[2]);\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[1]);\n        return NGX_CONF_ERROR;\n    }\n    uscf->shm_zone = ngx_shared_memory_add(cf, &value[1], size,\n                                           &ngx_http_upstream_module);\n    if (uscf->shm_zone == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    if (uscf->shm_zone->data) {\n        uscf = uscf->shm_zone->data;\n        ngx_conf_log_error(NGX_LOG_WARN, cf, 0,\n                           "upstream \\"%V\\" in %s:%ui "\n                           "is already bound to zone \\"%V\\"",\n                           &uscf->host, uscf->file_name, uscf->line,\n                           &value[1]);\n        return NGX_CONF_ERROR;\n    }\n    uscf->shm_zone->init = ngx_http_upstream_init_zone;\n    uscf->shm_zone->data = uscf;\n    uscf->shm_zone->noreuse = 1;\n    return NGX_CONF_OK;\n}', "ssize_t\nngx_parse_size(ngx_str_t *line)\n{\n    u_char   unit;\n    size_t   len;\n    ssize_t  size, scale, max;\n    len = line->len;\n    unit = line->data[len - 1];\n    switch (unit) {\n    case 'K':\n    case 'k':\n        len--;\n        max = NGX_MAX_SIZE_T_VALUE / 1024;\n        scale = 1024;\n        break;\n    case 'M':\n    case 'm':\n        len--;\n        max = NGX_MAX_SIZE_T_VALUE / (1024 * 1024);\n        scale = 1024 * 1024;\n        break;\n    default:\n        max = NGX_MAX_SIZE_T_VALUE;\n        scale = 1;\n    }\n    size = ngx_atosz(line->data, len);\n    if (size == NGX_ERROR || size > max) {\n        return NGX_ERROR;\n    }\n    size *= scale;\n    return size;\n}"]