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

src/http/modules/ngx_http_referer_module.c:391:13: Unknown value from: strcmp
389.         }
390. 
391.         if (ngx_strcmp(value[i].data, "none") == 0) {
                 ^
392.             rlcf->no_referer = 1;
393.             continue;

src/http/modules/ngx_http_referer_module.c:414:25: Call
412.                 if (sn[n].regex) {
413. 
414.                     if (ngx_http_add_regex_referer(cf, rlcf, &sn[n].name,
                             ^
415.                                                    sn[n].regex)
416.                         != NGX_OK)

src/http/modules/ngx_http_referer_module.c:500:1: <LHS trace>
498. 
499. 
500. static char *
     ^
501. ngx_http_add_regex_referer(ngx_conf_t *cf, ngx_http_referer_conf_t *rlcf,
502.     ngx_str_t *name, ngx_regex_t *regex)

src/http/modules/ngx_http_referer_module.c:500:1: Parameter `name->len`
  498. 
  499. 
  500. static char *
       ^
  501. ngx_http_add_regex_referer(ngx_conf_t *cf, ngx_http_referer_conf_t *rlcf,
  502.     ngx_str_t *name, ngx_regex_t *regex)

src/http/modules/ngx_http_referer_module.c:531:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ngx_http_add_regex_referer` 
  529.     err.data = errstr;
  530. 
  531.     name->len--;
           ^
  532.     name->data++;
  533. 

static char *
ngx_http_add_regex_referer(ngx_conf_t *cf, ngx_http_referer_conf_t *rlcf,
    ngx_str_t *name, ngx_regex_t *regex)
{
#if (NGX_PCRE)
    ngx_str_t         err;
    ngx_regex_elt_t  *re;
    u_char            errstr[NGX_MAX_CONF_ERRSTR];
    if (rlcf->regex == NGX_CONF_UNSET_PTR) {
        rlcf->regex = ngx_array_create(cf->pool, 2, sizeof(ngx_regex_elt_t));
        if (rlcf->regex == NULL) {
            return NGX_CONF_ERROR;
        }
    }
    re = ngx_array_push(rlcf->regex);
    if (re == NULL) {
        return NGX_CONF_ERROR;
    }
    if (regex) {
        re->regex = regex;
        re->name = name->data;
        return NGX_CONF_OK;
    }
    err.len = NGX_MAX_CONF_ERRSTR;
    err.data = errstr;
    name->len--;
    name->data++;
    re->regex = ngx_regex_compile(name, NGX_REGEX_CASELESS, cf->pool, &err);
    if (re->regex == NULL) {
        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%s", err.data);
        return NGX_CONF_ERROR;
    }
    re->name = name->data;
    return NGX_CONF_OK;
#else
    ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                       "the using of the regex \"%V\" requires PCRE library",
                       name);
    return NGX_CONF_ERROR;
#endif
}
['static char *\nngx_http_valid_referers(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)\n{\n    ngx_http_referer_conf_t  *rlcf = conf;\n    u_char                    *p;\n    ngx_str_t                 *value, uri, name;\n    ngx_uint_t                 i, n;\n    ngx_http_variable_t       *var;\n    ngx_http_server_name_t    *sn;\n    ngx_http_core_srv_conf_t  *cscf;\n    name.len = sizeof("invalid_referer") - 1;\n    name.data = (u_char *) "invalid_referer";\n    var = ngx_http_add_variable(cf, &name,\n                                NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOHASH);\n    if (var == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    var->get_handler = ngx_http_referer_variable;\n    if (rlcf->keys == NULL) {\n        rlcf->keys = ngx_pcalloc(cf->temp_pool, sizeof(ngx_hash_keys_arrays_t));\n        if (rlcf->keys == NULL) {\n            return NGX_CONF_ERROR;\n        }\n        rlcf->keys->pool = cf->pool;\n        rlcf->keys->temp_pool = cf->pool;\n        if (ngx_hash_keys_array_init(rlcf->keys, NGX_HASH_SMALL) != NGX_OK) {\n            return NGX_CONF_ERROR;\n        }\n    }\n    value = cf->args->elts;\n    for (i = 1; i < cf->args->nelts; i++) {\n        if (value[i].len == 0) {\n            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                               "invalid referer \\"%V\\"", &value[i]);\n            return NGX_CONF_ERROR;\n        }\n        if (ngx_strcmp(value[i].data, "none") == 0) {\n            rlcf->no_referer = 1;\n            continue;\n        }\n        if (ngx_strcmp(value[i].data, "blocked") == 0) {\n            rlcf->blocked_referer = 1;\n            continue;\n        }\n        uri.len = 0;\n        uri.data = NULL;\n        if (ngx_strcmp(value[i].data, "server_names") == 0) {\n            cscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_core_module);\n            sn = cscf->server_names.elts;\n            for (n = 0; n < cscf->server_names.nelts; n++) {\n#if (NGX_PCRE)\n                if (sn[n].regex) {\n                    if (ngx_http_add_regex_referer(cf, rlcf, &sn[n].name,\n                                                   sn[n].regex)\n                        != NGX_OK)\n                    {\n                        return NGX_CONF_ERROR;\n                    }\n                    continue;\n                }\n#endif\n                if (ngx_http_add_referer(cf, rlcf->keys, &sn[n].name, &uri)\n                    != NGX_OK)\n                {\n                    return NGX_CONF_ERROR;\n                }\n            }\n            continue;\n        }\n        if (value[i].data[0] == \'~\') {\n            if (ngx_http_add_regex_referer(cf, rlcf, &value[i], NULL) != NGX_OK)\n            {\n                return NGX_CONF_ERROR;\n            }\n            continue;\n        }\n        p = (u_char *) ngx_strchr(value[i].data, \'/\');\n        if (p) {\n            uri.len = (value[i].data + value[i].len) - p;\n            uri.data = p;\n            value[i].len = p - value[i].data;\n        }\n        if (ngx_http_add_referer(cf, rlcf->keys, &value[i], &uri) != NGX_OK) {\n            return NGX_CONF_ERROR;\n        }\n    }\n    return NGX_CONF_OK;\n}', 'static char *\nngx_http_add_regex_referer(ngx_conf_t *cf, ngx_http_referer_conf_t *rlcf,\n    ngx_str_t *name, ngx_regex_t *regex)\n{\n#if (NGX_PCRE)\n    ngx_str_t         err;\n    ngx_regex_elt_t  *re;\n    u_char            errstr[NGX_MAX_CONF_ERRSTR];\n    if (rlcf->regex == NGX_CONF_UNSET_PTR) {\n        rlcf->regex = ngx_array_create(cf->pool, 2, sizeof(ngx_regex_elt_t));\n        if (rlcf->regex == NULL) {\n            return NGX_CONF_ERROR;\n        }\n    }\n    re = ngx_array_push(rlcf->regex);\n    if (re == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    if (regex) {\n        re->regex = regex;\n        re->name = name->data;\n        return NGX_CONF_OK;\n    }\n    err.len = NGX_MAX_CONF_ERRSTR;\n    err.data = errstr;\n    name->len--;\n    name->data++;\n    re->regex = ngx_regex_compile(name, NGX_REGEX_CASELESS, cf->pool, &err);\n    if (re->regex == NULL) {\n        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%s", err.data);\n        return NGX_CONF_ERROR;\n    }\n    re->name = name->data;\n    return NGX_CONF_OK;\n#else\n    ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                       "the using of the regex \\"%V\\" requires PCRE library",\n                       name);\n    return NGX_CONF_ERROR;\n#endif\n}']