]> granicus.if.org Git - apache/commitdiff
mod_proxy_http: follow up to r1836588: fix drop of spurious 100 responses.
authorYann Ylavic <ylavic@apache.org>
Thu, 26 Jul 2018 17:51:09 +0000 (17:51 +0000)
committerYann Ylavic <ylavic@apache.org>
Thu, 26 Jul 2018 17:51:09 +0000 (17:51 +0000)
r1836588 broke t/security/CVE-2008-2364.t by forwarding more than one
"100 continue" response, fix it.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836750 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_http.c

index f98ba668bba22f747b9df69a436a696f2de2274f..941e2325ae3d8f9fbdc152a1a634dd6ee0a5d436 100644 (file)
@@ -1615,11 +1615,12 @@ int ap_proxy_http_process_response(proxy_http_req_t *req)
             ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r,
                           "HTTP: received interim %d response", r->status);
             if (!policy
-                    || !strcasecmp(policy, "RFC")
-                    || (proxy_status == HTTP_CONTINUE && req->expecting_100)) {
+                    || (!strcasecmp(policy, "RFC")
+                        && (proxy_status != HTTP_CONTINUE
+                            || (req->expecting_100 = 1)))) {
                 if (proxy_status == HTTP_CONTINUE) {
+                    r->expecting_100 = req->expecting_100;
                     req->expecting_100 = 0;
-                    r->expecting_100 = 1;
                 }
                 ap_send_interim_response(r, 1);
             }