Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4665 - in branches/stable-1.2: . src/http

Anonymous User
June 04, 2012 07:08AM
Author: mdounin
Date: 2012-06-04 11:07:19 +0000 (Mon, 04 Jun 2012)
New Revision: 4665
URL: http://trac.nginx.org/nginx/changeset/4665/nginx

Log:
Merge of r4618: rewrite escaping fix (ticket #162).

The following code resulted in incorrect escaping of uri and possible
segfault:

location / {
rewrite ^(.*) $1?c=$1;
return 200 "$uri";
}

If there were arguments in a rewrite's replacement string, and length was
actually calculated (due to duplicate captures as in the example above,
or variables present), the is_args flag was set and incorrectly copied
after length calculation. This resulted in escaping applied to the uri part
of the replacement, resulting in incorrect escaping. Additionally, buffer
was allocated without escaping expected, thus this also resulted in buffer
overrun and possible segfault.


Modified:
branches/stable-1.2/
branches/stable-1.2/src/http/ngx_http_script.c

Index: branches/stable-1.2
===================================================================
--- branches/stable-1.2 2012-06-04 11:00:34 UTC (rev 4664)
+++ branches/stable-1.2 2012-06-04 11:07:19 UTC (rev 4665)

Property changes on: branches/stable-1.2
___________________________________________________________________
Modified: svn:mergeinfo
## -1 +1 ##
-/trunk:4611-4613,4615-4617,4620
+/trunk:4611-4613,4615-4618,4620
\ No newline at end of property
Modified: branches/stable-1.2/src/http/ngx_http_script.c
===================================================================
--- branches/stable-1.2/src/http/ngx_http_script.c 2012-06-04 11:00:34 UTC (rev 4664)
+++ branches/stable-1.2/src/http/ngx_http_script.c 2012-06-04 11:07:19 UTC (rev 4665)
@@ -1043,7 +1043,6 @@
}

e->buf.len = len;
- e->is_args = le.is_args;
}

if (code->add_args && r->args.len) {

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

[nginx] svn commit: r4665 - in branches/stable-1.2: . src/http

Anonymous User 875 June 04, 2012 07:08AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

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