Welcome! Log In Create A New Profile

Advanced

Re: fix bug in http_referer_module that using incorrect input string length in the regex matching process when header Referer starts with https://

Sergey Kandaurov
August 13, 2013 11:26AM
On Aug 12, 2013, at 9:27 AM, Liangbin Li <lilb.edwin@gmail.com> wrote:
> --- ngx_http_referer_module.c
> +++ ngx_http_referer_module.c
> @@ -147,10 +147,12 @@
>
> if (ngx_strncasecmp(ref, (u_char *) "http://", 7) == 0) {
> ref += 7;
> + len -= 7;
> goto valid_scheme;
>
> } else if (ngx_strncasecmp(ref, (u_char *) "https://", 8) == 0) {
> ref += 8;
> + len -= 8;
> goto valid_scheme;
> }
> }
> @@ -191,7 +193,7 @@
> ngx_int_t rc;
> ngx_str_t referer;
>
> - referer.len = len - 7;
> + referer.len = len;
> referer.data = ref;
>
> rc = ngx_regex_exec_array(rlcf->regex, &referer, r->connection->log);

Committed, thanks!

--
Sergey Kandaurov
pluknet@nginx.com

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

fix bug in http_referer_module that using incorrect input string length in the regex matching process when header Referer starts with https://

Liangbin Li August 12, 2013 01:28AM

Re: fix bug in http_referer_module that using incorrect input string length in the regex matching process when header Referer starts with https://

Weibin Yao August 12, 2013 02:08AM

Re: fix bug in http_referer_module that using incorrect input string length in the regex matching process when header Referer starts with https://

Sergey Kandaurov August 13, 2013 11:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 178
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready