You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2017/06/29 00:16:27 UTC

svn commit: r1800215 - in /httpd/httpd/branches/2.4.x: CHANGES STATUS server/protocol.c

Author: wrowe
Date: Thu Jun 29 00:16:27 2017
New Revision: 1800215

URL: http://svn.apache.org/viewvc?rev=1800215&view=rev
Log:
Restore single-char field names inadvertantly disallowed in 2.4.25.
Backports: r1800173
PR: 61220 
Submitted by: ylavic
Reviewed by: wrowe, jchampion, ylavic


Modified:
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/server/protocol.c

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1800215&r1=1800214&r2=1800215&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Thu Jun 29 00:16:27 2017
@@ -3,6 +3,9 @@
 
 Changes with Apache 2.4.27
 
+  *) Allow single-char field names inadvertantly disallowed in 2.4.25.
+     PR 61220. [Yann Ylavic]
+
   *) core: Avoid duplicate HEAD in Allow header.
      This is a regression in 2.4.24 (unreleased), 2.4.25 and 2.4.26.
      PR 61207. [Christophe Jaillet]

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1800215&r1=1800214&r2=1800215&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Thu Jun 29 00:16:27 2017
@@ -140,15 +140,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
       2.4.x patch: svn merge -c 1551611,1783765,1788996,1788998,1789000,1795651 ^/httpd/httpd/trunk .
       +1: jailletc36, jim, ylavic
 
-   *) Restore single-char field names inadvertantly disallowed in 2.4.25.
-      Message ID: <CA...@mail.gmail.com>
-      Backports: r1800173
-      PR: 61220
-      Submitted by: ylavic
-      trunk patch: http://svn.apache.org/r1800173 (mod CHANGES)
-      2.4 patch: trunk works
-      +1: wrowe, ylavic, jchampion
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]

Modified: httpd/httpd/branches/2.4.x/server/protocol.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/protocol.c?rev=1800215&r1=1800214&r2=1800215&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/protocol.c (original)
+++ httpd/httpd/branches/2.4.x/server/protocol.c Thu Jun 29 00:16:27 2017
@@ -1088,8 +1088,12 @@ AP_DECLARE(void) ap_get_mime_headers_cor
                     return;
                 }
 
-                /* last character of field-name */
-                tmp_field = value - (value > last_field ? 1 : 0);
+                if (value == last_field) {
+                    r->status = HTTP_BAD_REQUEST;
+                    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03453)
+                                  "Request header field name was empty");
+                    return;
+                }
 
                 *value++ = '\0'; /* NUL-terminate at colon */
 
@@ -1112,13 +1116,6 @@ AP_DECLARE(void) ap_get_mime_headers_cor
                                   " bad whitespace");
                     return;
                 }
-
-                if (tmp_field == last_field) {
-                    r->status = HTTP_BAD_REQUEST;
-                    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03453)
-                                  "Request header field name was empty");
-                    return;
-                }
             }
             else /* Using strict RFC7230 parsing */
             {