Welcome! Log In Create A New Profile

Advanced

Re: pcre_exec() failed: -10

Maxim Dounin
January 26, 2016 11:56AM
Hello!

On Tue, Jan 26, 2016 at 10:03:16PM +0530, Krishna PMV wrote:

> Hello,
>
> I've a rule below in nginx config to 404 if the argument of search query is
> a non printable ascii character. Nginx is compiled with pcre and pcre
> seem** (refer 4.d below) to have utf8 support and unicode support enabled
> but nginx fails with "pcre_exec() failed: -10" error when it encounters the
> regex.
>
> Any pointers, please? Please refer below for more details.
>
> TIA,
>
> Krishna!
>
> *1. from nginx config*
>
> if ($args ~ "(*UTF8)^.*[^\x21-\x7E].*$") {
>
> return 404;
>
> }
>
> *..*
>
>
> *2. from access log:*
>
> 54.169.206.188 [26/Jan/2016:20:29:10
> /search?userQuery=Taurm\xE9+Taurme+Corporate+Casual+Slip+On+Shoe+()
>
> *3. from error log:*
>
> 2016/01/26 20:29:10 [alert] 27700#0: *43933484 on
> "userQuery=Taurm+Taurme+Corporate+Casual+Slip+On+Shoe+()" using
> "(*UTF8)^.*[^\x00-\x7F].*$", client: 54.169.206.188, server:
> search.paytm.com, request: "GET
> /search?userQuery=Taurm+Taurme+Corporate+Casual+Slip+On+Shoe+() HTTP/1.1",
> host: "search.paytm.com"

The error is returned by PCRE due to an invalid UTF-8 string being
checked as UTF-8 one. Note "\xE9" in the access log entry. Some
additional information can be found in the pcreunicode manpage.

--
Maxim Dounin
http://nginx.org/

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

pcre_exec() failed: -10

Krishna PMV January 26, 2016 11:56AM

Re: pcre_exec() failed: -10

Maxim Dounin January 26, 2016 11:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 247
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