On 12/12/2016 12:31 PM, yla...@apache.org wrote:
Author: ylavic
Date: Mon Dec 12 20:31:44 2016
New Revision: 1773865
URL: http://svn.apache.org/viewvc?rev=1773865&view=rev
Log:
Follow up to r1773761: improved recursion detection.
Modified:
httpd/httpd/trunk/modules/http/http_filters.c
Modified: httpd/httpd/trunk/modules/http/http_filters.c
URL:
http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?rev=1773865&r1=1773864&r2=1773865&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_filters.c (original)
+++ httpd/httpd/trunk/modules/http/http_filters.c Mon Dec 12 20:31:44 2016
@@ -687,6 +687,20 @@ static APR_INLINE int check_headers(requ
apr_table_do(check_header, &ctx, r->err_headers_out, NULL);
}
+static int check_headers_recursion(request_rec *r)
+{
+ request_rec *rr;
+ for (rr = r; rr; rr = rr->prev) {
+ void *dying = NULL;
+ apr_pool_userdata_get(&dying, "check_headers_recursion", rr->pool);
+ if (dying) {
+ return 1;
+ }
+ }
+ apr_pool_userdata_setn("true", "check_headers_recursion", NULL, r->pool);
+ return 0;
+}
+
What's the case where this catches recursion that the previous logic in
r1773861 did not handle? I'm trying to write a test that fails on
r1773861 and succeeds on r1773865, but I haven't figured it out yet.
--Jacob