]> granicus.if.org Git - apache/commitdiff
Merge r1773159 from trunk:
authorJim Jagielski <jim@apache.org>
Mon, 12 Dec 2016 15:22:49 +0000 (15:22 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 12 Dec 2016 15:22:49 +0000 (15:22 +0000)
Partial port of proposed r1773158 for httpd-2.x only; this change causes all
illegible protocol args to be rejected, irrespective of the strict toggle as
we expect this to occur with a garbage raw SP embedded in the request URI.

Simplifies the code using the protocol 0.9 sentinal to set up an http/1.0
error response.

String duplication of r1773158 is uninteresting, httpd-2.x has a const protocol
member.

Submitted by: rpluem, wrowe

Submitted by: wrowe
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1773802 13f79535-47bb-0310-9956-ffa450edef68

STATUS
server/protocol.c

diff --git a/STATUS b/STATUS
index bfb116b135b57ac14e0aeacd5acc5c8dc8cd479b..fffaa6e598150a2d241aa3cdb57cef9a69f24a59 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -117,16 +117,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) Propose we apr_pstrdup constant r->protocol assignments, and always fail
-     entirely invalid protocols (expecting these are part two of a URL with
-     embedded raw SP characters), without considering 'strict'-ness.
-     Backports: r1773159 through merge branch commit r1773161
-     Trunk patch:
-       https://svn.apache.org/r1773159
-     2.4.x patch:
-       https://svn.apache.org/r1773161
-     +1: wrowe, jim, ylavic
-
   *) With oddball whitespace now disallowed, strictness makes no difference
      in the two cases of field content handling. Noted by rpluem.
      Backports: r1773162 through merge branch commit r1773163
index 7bc292cb162479fde6504a0d14e2a363018ee7f8..63b358d4835ff19f2a4fe3884fea6f78aa086cad 100644 (file)
@@ -782,17 +782,14 @@ rrl_done:
             memcpy((char*)r->protocol, "HTTP", 4);
     }
     else if (r->protocol[0]) {
-        r->assbackwards = 0;
-        r->proto_num = HTTP_VERSION(1,0);
+        r->proto_num = HTTP_VERSION(0, 9);
         /* Defer setting the r->protocol string till error msg is composed */
-        if (strict && deferred_error == rrl_none)
+        if (deferred_error == rrl_none)
             deferred_error = rrl_badprotocol;
-        else
-            r->protocol  = "HTTP/1.0";
     }
     else {
         r->assbackwards = 1;
-        r->protocol = "HTTP/0.9";
+        r->protocol  = apr_pstrdup(r->pool, "HTTP/0.9");
         r->proto_num = HTTP_VERSION(0, 9);
     }
 
@@ -906,7 +903,7 @@ rrl_failed:
         r->assbackwards = 0;
         r->connection->keepalive = AP_CONN_CLOSE;
         r->proto_num = HTTP_VERSION(1, 0);
-        r->protocol  = "HTTP/1.0";
+        r->protocol  = apr_pstrdup(r->pool, "HTTP/1.0");
     }
     return 0;
 }